<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_ReturnToSoloStars"
      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>
        
        <local:FZMaterialPresetAcrylicPanel x:Key="A_FZMaterialPresetAcrylicPanel_PostRace_StarsReward"
                                        GlassColor="{StaticResource A_Color_Acrylic_PostRace}"
                                        EdgeColor="{StaticResource A_Color_Acrylic_PostRaceEdge}"
                                        Reflectivity="0.2"
                                        NormalDepth="0"
                                        GlassEmission="0.7" 
                                        EdgeEmission="1" 
                                        FrontEdgeTransparency="0.5" 
                                        RearTransparency="0.05" 
                                        BlurAmount="Low"
                                        ReflectionTextureType="Sharp" 
                                        SideReflectionIntensity="1"
                                        SubsurfaceIntensity="0.5"
                                        SubsurfaceSize="4"
                                        BasedOn="{StaticResource A_FZMaterialPresetAcrylicPanel_Highlight}"/>
        <Style x:Key="A_Style_FZMaterial_AcrylicPanel_PostRace_StarsReward" TargetType="local:FZMaterial"
               BasedOn="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_Fans}">
            <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetAcrylicPanel_PostRace_StarsReward}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_PostRace_StarsBonusText" TargetType="local:FZTextBlock" 
               BasedOn="{StaticResource A_Style_FZTextBlock_PostRace_BonusText}">
            <Setter Property="Color" Value="{StaticResource A_Color_GlossyBlack}" />
        </Style>
        
        <Style x:Key="A_Style_Control_PostRace_BonusValueBlock_Stars" 
           BasedOn="{StaticResource A_Style_Control_PostRace_BonusValueBlock}"
           TargetType="Control">
            <Setter Property="Tag" Value="/ForzaUI;component/Textures/Data_Bound/Mountain/Stars/Star_64.png" />
        </Style>

        <Style x:Key="A_Style_Control_PostRace_RewardLabelBlock" TargetType="Control" 
               BasedOn="{StaticResource A_Style_Control_PostRace_BonusLabelBlock}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid Visibility="{Binding Name, Converter={StaticResource A_StringVisConverter_UseHidden}}">
                            <local:FZMaterial x:Name="FrontFace" Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_StarsReward}">
                                <local:FZTextBlock x:Name="FrontFace_Text"
                                                   Style="{StaticResource A_Style_FZTextBlock_PostRace_StarsBonusText}"
                                                   Text="{Binding Name}"
                                                   VerticalAlignment="Center" HorizontalAlignment="Left" />
                            </local:FZMaterial>
                            <local:FZMaterial x:Name="BackFace" Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_StarsReward}">
                                <local:ZPanel.Transform>
                                    <Transform3DGroup>
                                        <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfSmallBlockHeight}">
                                            <RotateTransform3D.Rotation>
                                                <AxisAngleRotation3D Axis="-1,0,0" Angle="180" />
                                            </RotateTransform3D.Rotation>
                                        </RotateTransform3D>
                                    </Transform3DGroup>
                                </local:ZPanel.Transform>
                                <local:FZTextBlock x:Name="BackFace_Text"
                                                   Style="{StaticResource A_Style_FZTextBlock_PostRace_StarsBonusText}"
                                                   Text="{Binding Name}"
                                                   VerticalAlignment="Center" HorizontalAlignment="Left" Visibility="Hidden" />
                            </local:FZMaterial>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding ItemType}" Value="-1">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_Control_PostRace_RewardValueBlock" 
               BasedOn="{StaticResource A_Style_Control_PostRace_BonusValueBlock}"
               TargetType="Control">
            <Setter Property="Tag" Value="" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Decorator Visibility="{Binding Name, Converter={StaticResource A_StringVisConverter_UseHidden}}">
                            <Grid x:Name="OuterContainer">
                                <StackPanel x:Name="FrontFace" Orientation="Horizontal">
                                    <local:FZMaterial x:Name="UnitIcon_FrontFace"  Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                                    ImageSource="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                                    Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" />
                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}">
                                        <local:FZTextBlock x:Name="Text_FrontFace"
                                                           Style="{StaticResource A_Style_FZTextBlock_PostRace_BonusText}"
                                                           Text="{Binding Value}" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                    </local:FZMaterial>
                                </StackPanel>
                                <StackPanel x:Name="BackFace" Orientation="Horizontal">
                                    <local:ZPanel.Transform>
                                        <Transform3DGroup>
                                            <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfSmallBlockHeight}">
                                                <RotateTransform3D.Rotation>
                                                    <AxisAngleRotation3D Axis="-1,0,0" Angle="180" />
                                                </RotateTransform3D.Rotation>
                                            </RotateTransform3D>
                                        </Transform3DGroup>
                                    </local:ZPanel.Transform>
                                    <local:FZMaterial x:Name="UnitIcon_BackFace" Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                                    ImageSource="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                                    Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" />
                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}">
                                        <StackPanel Orientation="Horizontal" >
                                            <Decorator x:Name="BackfaceUnitIconSpacer" 
                                                       Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" 
                                                       Visibility="Collapsed" />
                                            <local:FZTextBlock x:Name="Text_BackFace"  
                                                           Style="{StaticResource A_Style_FZTextBlock_PostRace_BonusText}" Visibility="Hidden"
                                                           Text="{Binding Value}" VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        </StackPanel>
                                    </local:FZMaterial>
                                </StackPanel>
                            </Grid>
                        </Decorator>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding ItemType}" Value="-1">
                    <Setter Property="Visibility" Value="Collapsed" />
                </DataTrigger>
                <DataTrigger Binding="{Binding ItemType}" Value="0">
                    <Setter Property="Tag" Value="/ForzaUI;component/Textures/Anthem/Icons/XPIcon/EN/XP_64.png" />
                </DataTrigger>
                <DataTrigger Binding="{Binding ItemType}" Value="1">
                    <Setter Property="Tag" Value="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_64.png" />
                </DataTrigger>
                <DataTrigger Binding="{Binding ItemType}" Value="2">
                    <Setter Property="Tag" Value="/ForzaUI;component/Textures/Data_Bound/Mountain/PostRace/RewardIcons/Horn.png" />
                </DataTrigger>
                <DataTrigger Binding="{Binding ItemType}" Value="3">
                    <Setter Property="Tag" Value="/ForzaUI;component/Textures/Data_Bound/Mountain/PostRace/RewardIcons/Car.png" />
                </DataTrigger>                
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_Control_PostRace_TotalLabelBlock_Stars"
           BasedOn="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}"
           TargetType="Control">
            <Setter Property="Tag" Value="{local:Loc Mountain.IDS_PostRace_StarsTotal}" />
        </Style>

        <Style x:Key="A_Style_FrameworkElement_PostRace_TotalLabelBlock_Stars" TargetType="FrameworkElement"
           BasedOn="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock_Fans}" />

        <Style x:Key="A_Style_FrameworkElement_PostRace_NextLevelInfo"
               TargetType="FrameworkElement"
               BasedOn="{StaticResource A_Style_FrameworkElement_PostRace_SmallAnimatedBlock}">
        </Style>

            <ExponentialEase x:Key="A_EasingFunction_EaseInOut" EasingMode="EaseInOut"/>
        <ExponentialEase x:Key="A_EasingFunction_EaseIn" EasingMode="EaseInOut"/>
        <ExponentialEase x:Key="A_EasingFunction_EaseOut" EasingMode="EaseInOut"/>

        <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.5" Value="ShowBonusItem1"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.8" Value="ShowTotal"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.2" Value="ShowTarget"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.7" Value="StartLevelBarFillAnimation"/>
                <DiscreteStringKeyFrame KeyTime="0:0:3.2" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRace_FinalLevelUp" BeginTime="0:0:0">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" 
                                           Storyboard.TargetName="LevelBarEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value=""/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.0" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.2" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.4" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>
        
        <Storyboard x:Key="A_Storyboard_PostRace_LevelUpFlipBar" BeginTime="0:0:0">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" 
                                           Storyboard.TargetName="LevelBarEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value=""/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.206" Value="LevelBarMidFlip" />
                <DiscreteStringKeyFrame KeyTime="0:0:1.0" Value="StartLevelBarFillAnimation"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.6" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRace_LevelUpFlipObjective">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(Transform3DGroup.Children)[0].(RotateTransform3D.Rotation).(AxisAngleRotation3D.Angle)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.43"
                                      Value="-180"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRace_RewardValueFlipCommon" BeginTime="0:0:0">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(Transform3DGroup.Children)[0].(RotateTransform3D.Rotation).(AxisAngleRotation3D.Angle)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.43"
                                      Value="-180"
                                      EasingFunction="{StaticResource A_EasingFunction_EaseInOut}" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.5"
                                        Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayBonusItemOnAudio">
            <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/HZ3_SFX_HUD_PostRace_FansItemOn_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayStarsBarOnAudio">
            <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/HZ3_SFX_HUD_PostRace_FansTotalOn_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayObjectiveOnAudio">
            <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/HZ3_SFX_HUD_PostRace_FansObjectiveOn_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayObjectiveReachedAudio">
            <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/HZ3_SFX_HUD_PostRace_FanRewardsLevelUp_01" />
                <DiscreteStringKeyFrame KeyTime="0:0:2.23" Value="/Master/UI/PostRace/HZ3_SFX_HUD_PostRace_FanRewardsLevelBarFlip_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PlayFinalObjectiveReachedAudio">
            <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/HZ3_SFX_HUD_PostRace_FanRewardsLevelUp_01" />
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRaceStars_Show1Reward">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="RewardsEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="ShowRewardItem1"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.0" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.0" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:3.0" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRaceStars_Show2Rewards">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="RewardsEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="ShowRewardItem1"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.3" Value="ShowRewardItem2"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.3" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.3" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.8" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="A_Storyboard_PostRaceStars_Show3Rewards">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="RewardsEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="ShowRewardItem1"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.3" Value="ShowRewardItem2"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.6" Value="ShowRewardItem3"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.6" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.6" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:3.0" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>
        
        <Storyboard x:Key="A_Storyboard_PostRaceStars_Show4Rewards">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="RewardsEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value="ShowRewardItem1"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.3" Value="ShowRewardItem2"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.6" Value="ShowRewardItem3"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.9" Value="ShowRewardItem4"/>
                <DiscreteStringKeyFrame KeyTime="0:0:1.9" Value="Complete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:2.9" Value="AutoContinue"/>
                <DiscreteStringKeyFrame KeyTime="0:0:3.3" Value=""/>
            </StringAnimationUsingKeyFrames>
        </Storyboard>

        <ExponentialEase x:Key="A_EasingFunction_PulseTotal" EasingMode="EaseOut" />

        <Storyboard x:Key="A_Storyboard_SpinTotalToNextValue">
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:AudioEvent.SoundName)" Storyboard.TargetName="TotalPulseAudio">
                <DiscreteStringKeyFrame KeyTime="0:0:0.0" Value="" />
                <DiscreteStringKeyFrame KeyTime="0:0:0.001" Value="/Master/UI/Promo/UI_Promo_InfoScreenItemAppear" />
            </StringAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="TotalValueSpinnerTransform">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="1.2"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1" EasingFunction="{StaticResource A_EasingFunction_PulseTotal}"/>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleY" Storyboard.TargetName="TotalValueSpinnerTransform">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="1.2"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1" EasingFunction="{StaticResource A_EasingFunction_PulseTotal}"/>
            </DoubleAnimationUsingKeyFrames>
            <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="LevelBarValueEventFire" FillBehavior="Stop">
                <DiscreteStringKeyFrame KeyTime="0:0:0" Value=""/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.3" Value="SpinTotalComplete"/>
                <DiscreteStringKeyFrame KeyTime="0:0:0.4" 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,-82,0,0"
                  Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
                <StackPanel VerticalAlignment="Center" HorizontalAlignment="Left" Margin="190,0,0,0">
                    <ContentControl Content="{Binding ScreenTitle}"
                        HorizontalAlignment="Left"
                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                        local:BindingProxy.A="{Binding ScreenTitleIcon}" Margin="0,0,0,56" />

                    <Viewbox MaxHeight="680" HorizontalAlignment="Left" StretchDirection="DownOnly">
                        <StackPanel  VerticalAlignment="Center" HorizontalAlignment="Left">

                            <Decorator MinHeight="100">
                                <Grid Margin="0,0,0,49" VerticalAlignment="Top">
                                    <Grid.RowDefinitions>
                                        <RowDefinition />
                                    </Grid.RowDefinitions>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="Auto" />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>

                                    <Control x:Name="BonusLabel1" Style="{StaticResource A_Style_Control_PostRace_BonusLabelBlock}"
                                    Grid.Row="0" Grid.Column="0" DataContext="{Binding BonusItems[0]}" />
                                    <Control x:Name="BonusValue1" Style="{StaticResource A_Style_Control_PostRace_BonusValueBlock_Stars}" 
                                    Grid.Row="0" Grid.Column="1" DataContext="{Binding BonusItems[0]}" />
                                </Grid>
                            </Decorator>

                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Left" Margin="0,0,0,8" Panel.ZIndex="10">
                                <Control x:Name="TotalLabel" Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock_Stars}" />

                                <Grid x:Name="TotalValueAndLevelBar_FlashContainer" Margin="0,0,10,0">
                                    <Decorator x:Name="TotalValueAndLevelBar"
                              Style="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock_Stars}" Margin="0">
                                        <Grid x:Name="LevelBarFlipContainer" MinWidth="352">
                                            <local:ZPanel.Transform>
                                                <Transform3DGroup>
                                                    <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfLargeBlockHeight}">
                                                        <RotateTransform3D.Rotation>
                                                            <AxisAngleRotation3D Axis="-1,0,0" Angle="0" />
                                                        </RotateTransform3D.Rotation>
                                                    </RotateTransform3D>
                                                </Transform3DGroup>
                                            </local:ZPanel.Transform>
                                            <local:FZMaterial x:Name="MotionBlurExpander"  Margin="-50" Opacity="0" />
                                            <DockPanel x:Name="LevelBarContainer_Front">
                                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                        ImageSource="/ForzaUI;component/Textures/Data_Bound/Mountain/Stars/Star_256.png"
                                        Width="163"
                                        DockPanel.Dock="Left" />

                                                <Grid>
                                                    <ProgressBar x:Name="PART_LevelBar" Style="{StaticResource A_Style_ProgressBar_FansLevelBar}"
                                                        Value="{Binding DisplayedStarTotal, Converter={StaticResource A_IntToFloatConverter}}" 
                                                        Minimum="{Binding LevelBarMinimum, Converter={StaticResource A_IntToFloatConverter}}" 
                                                        Maximum="{Binding LevelBarMaximum, Converter={StaticResource A_IntToFloatConverter}}" Visibility="Hidden" />

                                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}" />

                                                    <Grid ClipToBounds="True" Height="163">
                                                        <Decorator x:Name="TotalValueSpinner" VerticalAlignment="Center"
                                                                    RenderTransformOrigin="0.5,0.5">
                                                            <Decorator.RenderTransform>
                                                                <ScaleTransform x:Name="TotalValueSpinnerTransform" />
                                                            </Decorator.RenderTransform>
                                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PostRace_TotalText}"
                                                                Text="{Binding NextStarTotal, Converter={StaticResource A_NumUnitConverter_ShowUnit_0dp}}" 
                                                                VerticalAlignment="Center" 
                                                                HorizontalAlignment="Right" 
                                                                TextAlignment="Right" />
                                                        </Decorator>
                                                    </Grid>
                                                </Grid>
                                            </DockPanel>
                                            <DockPanel x:Name="LevelBarContainer_Back" Visibility="Hidden">
                                                <local:ZPanel.Transform>
                                                    <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfLargeBlockHeight}">
                                                        <RotateTransform3D.Rotation>
                                                            <AxisAngleRotation3D Axis="-1,0,0" Angle="180" />
                                                        </RotateTransform3D.Rotation>
                                                    </RotateTransform3D>
                                                </local:ZPanel.Transform>
                                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                            ImageSource="/ForzaUI;component/Textures/Data_Bound/Mountain/Stars/PostRace256.png"
                                            Width="163"
                                            DockPanel.Dock="Left" />

                                                <Grid>
                                                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}" />

                                                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PostRace_TotalText}"
                                               Text="{Binding DisplayedStarTotal, Converter={StaticResource A_NumUnitConverter_ShowUnit_0dp}}" 
                                               VerticalAlignment="Center" 
                                               HorizontalAlignment="Right" 
                                               TextAlignment="Right" />
                                                </Grid>
                                            </DockPanel>

                                            <local:EventFire x:Name="LevelBarEventFire" />
                                            <local:EventFire x:Name="NextObjectiveEventFire" />
                                        </Grid>
                                    </Decorator>
                                </Grid>
                            </StackPanel>

                            <StackPanel x:Name="NextLevelInfoContainer" Orientation="Horizontal"
                                        Style="{StaticResource A_Style_FrameworkElement_PostRace_NextLevelInfo}"
                                        Margin="0,0,0,8">
                                <Grid>
                                    <local:FZMaterial x:Name="NextLevelLabel_Front"  Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}">
                                        <local:FZTextBlock Text="{Binding StarsToNextTargetLabel}" 
                                               Style="{StaticResource A_Style_FZTextBlock_PostRace_NextRewardText}" 
                                               Color="{StaticResource A_Color_GlossyBlack}" />
                                    </local:FZMaterial>

                                    <local:FZMaterial x:Name="NextLevelLabel_Back" Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}">
                                        <local:ZPanel.Transform>
                                            <Transform3DGroup>
                                                <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfSmallBlockHeight}">
                                                    <RotateTransform3D.Rotation>
                                                        <AxisAngleRotation3D Axis="-1,0,0" Angle="180" />
                                                    </RotateTransform3D.Rotation>
                                                </RotateTransform3D>
                                            </Transform3DGroup>
                                        </local:ZPanel.Transform>
                                        <local:FZTextBlock Text="{Binding StarsToNextTargetLabel}" 
                                               Style="{StaticResource A_Style_FZTextBlock_PostRace_NextRewardText}" 
                                               Color="{StaticResource A_Color_GlossyBlack}" />
                                    </local:FZMaterial>
                                </Grid>

                                <Grid x:Name="StarsToNextLevelValueContainer" Margin="8,0,0,0">
                                    <local:ZPanel.Transform>
                                        <Transform3DGroup>
                                            <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfSmallBlockHeight}">
                                                <RotateTransform3D.Rotation>
                                                    <AxisAngleRotation3D Axis="-1,0,0" Angle="0" />
                                                </RotateTransform3D.Rotation>
                                            </RotateTransform3D>
                                        </Transform3DGroup>
                                    </local:ZPanel.Transform>

                                    <StackPanel x:Name="StarsToNextLevelValue_Front" Orientation="Horizontal">
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                        ImageSource="/ForzaUI;component/Textures/Data_Bound/Mountain/Stars/Star_64.png"
                                        Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" />

                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}">
                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PostRace_NextRewardText}"
                                        Text="{Binding StarsToNextTarget, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                        VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        </local:FZMaterial>
                                    </StackPanel>

                                    <StackPanel x:Name="StarsToNextLevelValue_Back" Orientation="Horizontal" >
                                        <local:ZPanel.Transform>
                                            <Transform3DGroup>
                                                <RotateTransform3D CenterY="{StaticResource A_Double_PostRace_HalfSmallBlockHeight}">
                                                    <RotateTransform3D.Rotation>
                                                        <AxisAngleRotation3D Axis="-1,0,0" Angle="180" />
                                                    </RotateTransform3D.Rotation>
                                                </RotateTransform3D>
                                            </Transform3DGroup>
                                        </local:ZPanel.Transform>

                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_Tile_Background}"
                                        ImageSource="/ForzaUI;component/Textures/Data_Bound/Mountain/Stars/Star_64.png"
                                        Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}" />

                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_AcrylicPanel_PostRace_RewardBoxPanel}">
                                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PostRace_NextRewardText}"
                                        Text="{Binding StarsToNextTarget, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                        VerticalAlignment="Center" HorizontalAlignment="Right" />
                                        </local:FZMaterial>
                                    </StackPanel>
                                </Grid>
                            </StackPanel>

                            <Grid Margin="0,52,0,0">
                                <Grid.RowDefinitions>
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition />
                                </Grid.ColumnDefinitions>
                                
                                <Control x:Name="RewardLabel1" Style="{StaticResource A_Style_Control_PostRace_RewardLabelBlock}"
                                         Grid.Row="0" Grid.Column="0"
                                         DataContext="{Binding RewardItems[0]}" />                                    
                                <Control x:Name="RewardValue1" Style="{StaticResource A_Style_Control_PostRace_RewardValueBlock}" 
                                         DataContext="{Binding RewardItems[0]}"
                                         Grid.Row="0" Grid.Column="1" />

                                <Control x:Name="RewardLabel2" Style="{StaticResource A_Style_Control_PostRace_RewardLabelBlock}"
                                         Grid.Row="1" Grid.Column="0"
                                         DataContext="{Binding RewardItems[1]}" />
                                <Control x:Name="RewardValue2" Style="{StaticResource A_Style_Control_PostRace_RewardValueBlock}" 
                                         DataContext="{Binding RewardItems[1]}"
                                         Grid.Row="1" Grid.Column="1" />

                                <Control x:Name="RewardLabel3" Style="{StaticResource A_Style_Control_PostRace_RewardLabelBlock}"
                                         Grid.Row="2" Grid.Column="0"
                                         DataContext="{Binding RewardItems[2]}" />
                                <Control x:Name="RewardValue3" Style="{StaticResource A_Style_Control_PostRace_RewardValueBlock}" 
                                         DataContext="{Binding RewardItems[2]}"
                                         Grid.Row="2" Grid.Column="1" />

                                <Control x:Name="RewardLabel4" Style="{StaticResource A_Style_Control_PostRace_RewardLabelBlock}"
                                         Grid.Row="3" Grid.Column="0"
                                         DataContext="{Binding RewardItems[3]}" />
                                <Control x:Name="RewardValue4" Style="{StaticResource A_Style_Control_PostRace_RewardValueBlock}" 
                                         DataContext="{Binding RewardItems[3]}"
                                         Grid.Row="3" Grid.Column="1" />
                            </Grid>
                        </StackPanel>
                    </Viewbox>
                </StackPanel>

                <local:AudioEvent x:Name="BonusItemAudio1" />
                <local:AudioEvent x:Name="BonusItemAudio2" />
                <local:AudioEvent x:Name="BonusItemAudio3" />
                <local:AudioEvent x:Name="BonusItemAudio4" />
                <local:AudioEvent x:Name="TotalAudio" />
                <local:AudioEvent x:Name="ObjectiveAudio" />
                <local:AudioEvent x:Name="ObjectiveAchieveAudio" />
                <local:AudioEvent x:Name="ObjectiveIncreaseAudio" />
                <local:AudioEvent x:Name="LevelUpAudio" />
                <local:AudioEvent x:Name="TotalPulseAudio" />

                <local:EventFire x:Name="EventFire" />
                <local:EventFire x:Name="LevelBarValueEventFire" />
                <local:EventFire x:Name="RewardsEventFire" />

                <local:EventFire.FzTriggers>
                    <local:EventFireTrigger Event="ShowBonusItem1" TargetName="BonusLabel1" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowBonusItem1" TargetName="BonusValue1" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowBonusItem1" TargetName="BonusItemAudio1" Storyboard="{StaticResource A_Storyboard_PlayBonusItemOnAudio}" />
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalLabel" Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalValueAndLevelBar" Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromRight_Slide}" />
                    <local:EventFireTrigger Event="ShowTotal" TargetName="TotalAudio" Storyboard="{StaticResource A_Storyboard_PlayStarsBarOnAudio}" />
                    <local:EventFireTrigger Event="ShowTarget" TargetName="NextLevelInfoContainer" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />

                    <local:EventFireTrigger Event="LevelUp" TargetName="LevelBarFlipContainer" Storyboard="{StaticResource A_Storyboard_PostRace_LevelUpFlipBar}" />
                    <local:EventFireTrigger Event="LevelUp" TargetName="NextLevelInfoContainer" Storyboard="{StaticResource A_Storyboard_PostRace_RewardValueFlipCommon}" />

                    <local:EventFireTrigger Event="FinalLevelUp" TargetName="LevelBarFlipContainer" Storyboard="{StaticResource A_Storyboard_PostRace_FinalLevelUp}" />

                    <local:EventFireTrigger Event="ShowRewardItem1" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem1" TargetName="RewardValue1" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem1" TargetName="ObjectiveAudio" Storyboard="{StaticResource A_Storyboard_PlayObjectiveOnAudio}" />
                    <local:EventFireTrigger Event="ShowRewardItem2" TargetName="RewardLabel2" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem2" TargetName="RewardValue2" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem2" TargetName="ObjectiveAudio" Storyboard="{StaticResource A_Storyboard_PlayObjectiveOnAudio}" />
                    <local:EventFireTrigger Event="ShowRewardItem3" TargetName="RewardLabel3" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem3" TargetName="RewardValue3" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem3" TargetName="ObjectiveAudio" Storyboard="{StaticResource A_Storyboard_PlayObjectiveOnAudio}" />
                    <local:EventFireTrigger Event="ShowRewardItem4" TargetName="RewardLabel4" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem4" TargetName="RewardValue4" Storyboard="{StaticResource A_Storyboard_PostRace_RowIn}" />
                    <local:EventFireTrigger Event="ShowRewardItem4" TargetName="ObjectiveAudio" Storyboard="{StaticResource A_Storyboard_PlayObjectiveOnAudio}" />

                    <local:EventFireTrigger Event="Show1Rewards" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRaceStars_Show1Reward}" />
                    <local:EventFireTrigger Event="Show2Rewards" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRaceStars_Show2Rewards}" />
                    <local:EventFireTrigger Event="Show3Rewards" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRaceStars_Show3Rewards}" />
                    <local:EventFireTrigger Event="Show4Rewards" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRaceStars_Show4Rewards}" />

                    <local:EventFireTrigger Event="SkipIntro" TargetName="BonusLabel1" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="BonusValue1" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="TotalLabel" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="TotalValueAndLevelBar" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="NextLevelInfoContainer" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardLabel1" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardValue1" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardLabel2" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardValue2" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardLabel3" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardValue3" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardLabel4" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                    <local:EventFireTrigger Event="SkipIntro" TargetName="RewardValue4" Storyboard="{StaticResource A_Storyboard_PostRace_SkipIntro}" />
                </local:EventFire.FzTriggers>
            </Grid>
        </Decorator>
    </Grid>
</Page>
