<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
      x:Class="ForzaUI.Scenes.Anthem.A_PostRaceOnlineRoadTripComplete"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">
    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_PostRace}"/>
    </local:UIPageTransitionManager.TransitionManager>
    <Page.Resources>
        <Style x:Key="A_Style_Control_PostRace_BonusValueBlock_Cr" 
               BasedOn="{StaticResource A_Style_Control_PostRace_BonusValueBlock}"
               TargetType="Control">
            <Setter Property="Tag" Value="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_64.png" />
        </Style>

        <Storyboard x:Key="A_Storyboard_PlayBalanceOnAudio">
            <StringAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="" />
                <DiscreteStringKeyFrame KeyTime="0:0:0.01" Value="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_CashRewardsBalanceOn_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayTotalOnAudio">
            <StringAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}" Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="" />
                <DiscreteStringKeyFrame KeyTime="0:0:0.01" Value="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_CashRewardsTotalOn_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRace_Show_1Bonus">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="EventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value=""/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.3" Value="ShowTotal"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.7" Value="ShowBalance"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.2" Value="StartTotalTicker"/>
                <DiscreteStringKeyFrame KeyTime="0:0:3.7" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:4.2" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:4.3" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>
    </Page.Resources>
    <Grid>
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                    Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
        <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
            <Grid Margin="0,-37,0,37"
                  Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
                <StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Margin="190,0,0,0">
                    <ContentControl Content="{local:Loc ScreenTitles.IDS_PostRaceRoadTripComplete}"
                        HorizontalAlignment="Left"
                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/freeroam.png" />

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8" Panel.ZIndex="10">
                        <Control x:Name="TotalLabel" Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}"
                                 Tag="{Binding TotalLabel}"/>
                        <Control x:Name="TotalValue" Style="{StaticResource A_Style_Control_PostRace_TotalValueBlock}"
                                 Tag="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_256.png" />
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Left">
                        <Control x:Name="BalanceLabel" Style="{StaticResource A_Style_Control_PostRace_BalanceLabelBlock}" />
                        <Control x:Name="BalanceValue" Style="{StaticResource A_Style_Control_PostRace_BalanceValueBlock}"
                                 Tag="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_64.png" />
                    </StackPanel>
                </StackPanel>

                <local:AudioEvent x:Name="BalanceAudio" />
                <local:AudioEvent x:Name="TotalAudio" />
                
                <local:EventFire x:Name="EventFire" />

                <local:EventFire.FzTriggers>
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalLabel" Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalValue" Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromRight_Slide}" />
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalAudio" Storyboard="{StaticResource A_Storyboard_PlayTotalOnAudio}" />
                    <local:EventFireTrigger Event="ShowBalance" TargetName="BalanceLabel" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowBalance" TargetName="BalanceValue" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowBalance" TargetName="BalanceAudio" Storyboard="{StaticResource A_Storyboard_PlayBalanceOnAudio}" />

                    <local:EventFireTrigger Event="SkipIntro" TargetName="TotalLabel" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="TotalValue" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="BalanceLabel" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="BalanceValue" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                </local:EventFire.FzTriggers>
            </Grid>
        </Decorator>
    </Grid>
</Page>
