<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      x:Class="ForzaUI.A_Hud"
      x:Name="Page"
      WindowTitle="Page"
      FlowDirection="LeftToRight"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Hud}" />
    </local:UIPageTransitionManager.TransitionManager>

    <Grid Style="{StaticResource A_Style_FrameworkElement_FadeOnlyTransition_0}">
        <!-- screen space shadow -->
        <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetScreenShadow_ARUI}" />

        <Grid x:Name="LayoutRoot"
              Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}"
              HorizontalAlignment="Stretch"
              VerticalAlignment="Stretch"
              Height="Auto"
              Width="Auto">
            <Grid x:Name="AdjustableSafeFrame"
                  Margin="{Binding SafeFrameMargin}">

                <!-- HUD Controls -->
                <StackPanel Orientation="Vertical"
                    HorizontalAlignment="Left"
                    VerticalAlignment="Bottom"
                    Margin="0,0,0,349">
                    <local:HUDActivationControl x:Name="HUDStatusActivation"
                        Margin="0,0,0,24"
                        PinnedChallengeHeight="{Binding PinnedChallengeHeight, Mode=OneWayToSource}"/>
                    <Viewbox MinHeight="134"
                        MaxHeight="235"
                        Stretch="Uniform"
                        StretchDirection="DownOnly"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Bottom">
                        <local:HUDPinnedChallengeControl x:Name="HUDStatusPinnedChallenge"
                            Margin="0,0,0,0"
                            local:AttachedRoutedEventCommand.Command="{Binding OnPinnedChallengeSizeChanged, ElementName=HUDStatusActivation, FallbackValue={x:Null}}"
                            local:AttachedRoutedEventCommand.RoutedEvent="FrameworkElement.SizeChanged"/>
                    </Viewbox>
                </StackPanel>

                <!--Always On-->
                <local:HUDAnnaControl x:Name="HUDStatusAnna" />
                <local:HUDSpeedometerControl x:Name="HUDStatusSpeedometer" />
                <local:HUDRadioControl x:Name="HUDStatusRadio" />
                <local:HUDActivityInvitationControl x:Name="HUDStatusActivityInvitation" />
                <Decorator DataContext="{Binding DataContext, ElementName=HUDStatusSpeedometer}"
                           Style="{StaticResource A_Style_FrameworkElement_WaitSpinnerPositioner}">
                    <local:HUDWaitSpinnerControl x:Name="HUDStatusWaitSpinner" />
                </Decorator>
                <local:HUDSkillControl x:Name="HUDStatusSkill" />
                <local:HUDSkillTokenControl x:Name="HUDStatusSkillToken"/>
                <local:HUDSkillSongControl x:Name="HUDStatusSkillSong"/>

                <!--SimpleStatusControls-->
                <local:HUDWrongWayControl x:Name="HUDStatusWrongWay"
                                          Margin="0,243,0,0"
                                          VerticalAlignment="Top" />

                <!--Race Controls-->
                <StackPanel HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Orientation="Vertical">
                  <local:HUDRaceProgressControl x:Name="HUDStatusRaceProgress"
                                                VerticalAlignment="Top"/>
                  <local:HUDInstructionControl x:Name="HUDStatusInstruction"
                                               VerticalAlignment="Top"
                                               Visibility="{Binding IsVisibilityOptionEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                </StackPanel>
                <local:HUDMiniLeaderboardControl x:Name="HUDStatusMiniLeaderboard" />
                <!-- Notifications and Transient Controls -->
                <local:HUDMajorNotificationControl x:Name="HUDStatusMajorNotification" />

                <local:HUDBrickChallengeCompletedControl x:Name="HUDStatusBrickChallengeCompleted" />

                <local:HUDXPAwardControl x:Name="HUDStatusXPAward"/>

                <!-- Network Controls -->
                <local:HUDNetworkStatusControl x:Name="HUDStatusNetworkStatus"/>

                <local:HUDDriveToEventControl x:Name="HUDStatusNetworkRoadTripDestinationDrive"/>
                <local:HUDRaceFinishCountdownControl x:Name="HUDStatusRaceCountdown" />

                <local:HUDChallengeControl x:Name="HUDStatusChallenge"/>

                <local:HUDTrackChallengeControl x:Name="HUDStatusTrackChallenge" />

                <local:HUDMinorNotificationControl x:Name="HUDStatusMinorNotification" />

                <local:HUDStuntPartyProgressControl x:Name="HUDStatusStuntPartyProgress" />

                <StackPanel Margin="0,0,0,0" VerticalAlignment="Bottom">
                    <local:HUDRivalsEverywhereControl x:Name="HUDStatusRivalsEverywhere" Margin="0,0,0,0"/>
                    <local:HUDPressButtonControl x:Name="HUDStatusPressButton" Margin="0,0,0,-7"/>
                </StackPanel>

                <Decorator x:Name="HUDStatusDummyNotInHUD"/>
            </Grid>
        </Grid>
    </Grid>
</Page>
