<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_PostRaceTeamScore"
      mc:Ignorable="d"
      x:Name="Page"
      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="Width"
                    Value="200" />
            <Setter Property="Tag"
                    Value="/ForzaUI;component/Textures/Anthem/Icons/CRIcon/CR_85_FilledCircle.png" />
        </Style>

        <System:Double x:Key="A_Double_ScoreHeaderAndName_MaxHeight">180</System:Double>
        <System:Double x:Key="A_Double_ScoreHeaderAndName_MaxWidth">525</System:Double>
        <System:Double x:Key="A_Double_CreditRewardItem_Offset">48</System:Double>

        <System:Double x:Key="A_Double_ScoreHeaderAndName_SpacerHeight">15</System:Double>
        <System:Double x:Key="A_Double_ScoreHeaderAndName_SpacerHeight_CHS">46</System:Double>
        <System:Double x:Key="A_Double_ScoreHeaderAndName_SpacerHeight_CHT">46</System:Double>

        <Size x:Key="A_Size_PostRace_GamerPicSizeParams">424,424</Size>

        <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PostRace_Gamerpic" />

        <ImageBrush x:Key="A_Brush_GamerpicOpacity"
                    ImageSource="/ForzaUI;component/Textures/Data_Bound/PostRace/Gamerpic_Mask.png" />

        <local:TeamConverter x:Key="A_Converter_Team" />

        <Style x:Key="A_Style_Control_PostRace_TotalLabelBlock"
               TargetType="Control"
               BasedOn="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock}">
            <Setter Property="Tag"
                    Value="" />
            <Setter Property="HorizontalContentAlignment"
                    Value="Left" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <local:FZTextBlock Style="{DynamicResource A_Style_FZTextBlock_PostRace_TotalText}"
                                           Text="{TemplateBinding Tag}"
                                           CapHeight="43"
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />

                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Setter Property="local:ZPanel.Transform">
                <Setter.Value>
                    <Transform3DGroup>
                        <RotateTransform3D />
                        <TranslateTransform3D OffsetZ="0" />
                    </Transform3DGroup>
                </Setter.Value>
            </Setter>
        </Style>

        <System:Double x:Key="A_Double_TeamNameLabelCapHeight">134</System:Double>
        
        <Style x:Key="A_Style_Control_PostRace_TeamNameBlock"
               TargetType="Control"
               BasedOn="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}">
            <Setter Property="HorizontalAlignment"
                    Value="Left" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Viewbox Stretch="Uniform"
                                 HorizontalAlignment="Left"
                                 StretchDirection="DownOnly">
                            <Grid>
                                <StackPanel Orientation="Horizontal">
                                    <!--The additive presets in here only work when you null the motionblur effect on the control root.  This is used by impact bloom on the total values-->
                                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PostRace_TotalText}"
                                                       Preset="{StaticResource A_FZMaterialPresetAdditive}"
                                                       CapHeight="{DynamicResource A_Double_TeamNameLabelCapHeight}"
                                                       x:Name="TickerValue"
                                                       Text="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                                       VerticalAlignment="Center" />

                                </StackPanel>
                            </Grid>
                        </Viewbox>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <System:TimeSpan x:Key="A_TimeSpan_Transition_Overlap">-0:0:0.1</System:TimeSpan>
        
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Begin"
                             KeyTime="0:0:0" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_EventWinner_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Begin}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_EventWinner_Gamerpic_In"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                             Offset="0:0:0.06"/>
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_EventWinner_End"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                             Offset="0:0:2.8"/>

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_End}"
                             Offset="{StaticResource A_TimeSpan_Transition_Overlap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Land"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                             Offset="0:0:0.6" />
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Divide_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Land}"
                             Offset="-0:0:0.6" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Slam_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Land}"
                             Offset="0:0:0.3" />

        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_AlphaOn_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Slam_Begin}"
                             Offset="0:0:0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_AlphaOn_End"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_AlphaOn_Begin}"
                             Offset="0:0:0.2" />

        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_MotionOn_Begin"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_AlphaOn_Begin}"
                             Offset="0:0:0.0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_MotionOn_Begin_Audio"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_Begin}"
                             Offset="0:0:0.2" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_MotionOn_End"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_Begin}"
                             Offset="0:0:0.5" />

        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_OldScore_AlphaOff_Begin"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                             Offset="-0:0:0.06" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_OldScore_AlphaOff_End"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                             Offset="0:0:0.0" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Sparkle"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                             Offset="0:0:0.0" />

        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_Glow_On_Begin"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                             Offset="-0:0:0.06" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_Glow_On_End"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_Begin}"
                             Offset="0:0:0.3" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_Alpha_Off_Begin"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_End}"
                             Offset="0:0:0.0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Score_Slam_Alpha_Off_End"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_Alpha_Off_Begin}"
                             Offset="0:0:0.6" />
        
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScoresShown"
                             KeyTime="{StaticResource A_KeyTime_Score_Slam_Alpha_Off_End}"
                             Offset="0:0:0.0" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_End"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Slam_Begin}"
                             Offset="0:0:4" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Scores_Sparkles_Out"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                             Offset="0:0:0.2" />

        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_SeriesWinner_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                             Offset="{StaticResource A_TimeSpan_Transition_Overlap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_SeriesWinner_Gamerpic_In"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                             Offset="0:0:0.06" />
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_SeriesWinner_End"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                             Offset="0:0:4" />

        <System:TimeSpan x:Key="A_Timespan_GamerTagGap">0:0:0.2</System:TimeSpan>
        
        <local:OffsetKeyTime x:Key="A_KeyTime_TeamScore_Lineup_Begin"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_End}"
                             Offset="0:0:0.0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag0"
                             KeyTime="{StaticResource A_KeyTime_TeamScore_Lineup_Begin}"
                             Offset="0:0:0.6" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag1"
                             KeyTime="{StaticResource A_KeyTime_Gamertag0}"
                             Offset="{StaticResource A_Timespan_GamerTagGap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag2"
                             KeyTime="{StaticResource A_KeyTime_Gamertag1}"
                             Offset="{StaticResource A_Timespan_GamerTagGap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag3"
                             KeyTime="{StaticResource A_KeyTime_Gamertag2}"
                             Offset="{StaticResource A_Timespan_GamerTagGap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag4"
                             KeyTime="{StaticResource A_KeyTime_Gamertag3}"
                             Offset="{StaticResource A_Timespan_GamerTagGap}" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Gamertag5"
                             KeyTime="{StaticResource A_KeyTime_Gamertag4}"
                             Offset="{StaticResource A_Timespan_GamerTagGap}" />

        <local:OffsetKeyTime x:Key="A_KeyTime_Continue"
                             KeyTime="{StaticResource A_KeyTime_Gamertag5}"
                             Offset="0:0:5" />

        <Storyboard x:Key="A_Storyboard_ToDivided">
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                             To="0"
                             Duration="0:0:0.2"
                             EasingFunction="{local:ExponentialEasing EasingMode=EaseIn}" />
        </Storyboard>
        <Storyboard x:Key="A_Storyboard_FromDivided">
            <DoubleAnimation Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                             From="0"
                             Duration="0:0:0.2"
                             EasingFunction="{local:ExponentialEasing EasingMode=EaseIn}" />
        </Storyboard>

        <local:UIStoryboard x:Key="A_Storyboard_GamerpicIn"
                            DurationOverride="{StaticResource A_Duration_Transition_ElementIn}">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(Transform3DGroup.Children)[1].(TranslateTransform3D.OffsetX)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="-1000" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.43"
                                      Value="0"
                                      EasingFunction="{local:ExponentialEasing EasingMode=EaseIn}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.129"
                                      Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_SlotInFromRight">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(Transform3DGroup.Children)[1].(TranslateTransform3D.OffsetX)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="{StaticResource A_Double_PostRace_WhooshInFromRight_StartPositionXOffset}" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                      Value="0"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseOut}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0.5" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.2"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <System:Double x:Key="A_Double_NewScore_Scale">2.4</System:Double>

        
        <TriggerActionCollection x:Key="A_TriggerAnimation_TeamScore">
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Gamerpic_In}"
                                     Storyboard.TargetName="Gamerpic"
                                     Storyboard="{StaticResource A_Storyboard_GamerpicIn}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                                     Storyboard.TargetName="TotalLabel"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft_Slide}" />
            <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                                     EventName="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_TitleOn_01" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                                     Storyboard.TargetName="TotalValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />
            <local:AudioEventFireTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                                         AudioEvent="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_CashRewardsTotalOn_01" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_Begin}"
                                     Storyboard.TargetName="BalanceValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromRight_Slide}" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_End}"
                                     Storyboard.TargetName="TotalLabel"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_End}"
                                     Storyboard.TargetName="TotalValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_End}"
                                     Storyboard.TargetName="BalanceValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_EventWinner_End}"
                                     Storyboard.TargetName="Gamerpic"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />

            <local:PlayVideoTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Sparkle}"
                                    Storyboard.TargetName="Video" />

            <local:StopVideoTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Sparkles_Out}"
                                    Storyboard.TargetName="Video" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                                     Storyboard.TargetName="TeamScore_Team"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft_Slide}" />
            <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                                     EventName="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_XPRewardsTitleOn_01" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                                     Storyboard.TargetName="TeamScore_Score"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromRight_Slide}" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                                     Storyboard.TargetName="WinnerScore"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Begin}"
                                     Storyboard.TargetName="LoserScore"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Divide_Begin}"
                                     Storyboard.TargetName="BackgroundDivide"
                                     HandoffBehavior="Compose"
                                     Storyboard="{StaticResource A_Storyboard_ToDivided}" />

            <local:RaiseFzEvent Storyboard.TargetName="TeamScoresComplete"
                                local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScoresShown}"
                                EventName="TeamScoresComplete" />

            <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_Begin_Audio}"
                                     EventName="/Master/UI/E3/UI_Forzathon_Success" />
        </TriggerActionCollection>

        <TriggerActionCollection x:Key="A_TriggerAnimation_TeamScore_SecondHalf">
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                     Storyboard.TargetName="TeamScore_Team"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}"
                                     HandoffBehavior="Compose" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                     Storyboard.TargetName="TeamScore_Score"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToLeft}"
                                     HandoffBehavior="Compose" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                     Storyboard.TargetName="WinnerScore"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}"
                                     HandoffBehavior="Compose" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                     Storyboard.TargetName="LoserScore"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}"
                                     HandoffBehavior="Compose" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                     Storyboard.TargetName="BackgroundDivide"
                                     Storyboard="{StaticResource A_Storyboard_FromDivided}" />


            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Gamerpic_In}"
                                     Storyboard.TargetName="Gamerpic"
                                     Storyboard="{StaticResource A_Storyboard_GamerpicIn}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                                     Storyboard.TargetName="TotalLabel"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft_Slide}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                                     Storyboard.TargetName="TotalValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromLeft}" />
            <local:AudioEventFireTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                                         AudioEvent="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_CashRewardsTotalOn_01" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                                     Storyboard.TargetName="BalanceValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshInFromRight_Slide}" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_End}"
                                     Storyboard.TargetName="TotalLabel"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_End}"
                                     Storyboard.TargetName="TotalValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToRight}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_End}"
                                     Storyboard.TargetName="BalanceValue"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToLeft}" />
            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_End}"
                                     Storyboard.TargetName="Gamerpic"
                                     Storyboard="{StaticResource A_Storyboard_PostRace_WhooshOutToLeft}" />

            <local:BeginUIStoryboard local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Lineup_Begin}"
                                     Storyboard.TargetName="LineupGamerpics"
                                     Storyboard="{StaticResource A_Storyboard_SlotInFromRight}" />
            <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_TeamScore_Lineup_Begin}"
                                     EventName="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_XPRewardsTitleOn_01" />

            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag0}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag0" />
            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag1}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag1" />
            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag2}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag2" />
            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag3}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag3" />
            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag4}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag4" />
            <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Gamertag5}"
                                Storyboard.TargetName="LineupGamerpics"
                                EventName="tag5" />

            <local:RaiseFzEvent Storyboard.TargetName="EventFire"
                                EventName="Complete"
                                local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Continue}" />
            <local:RaiseFzEvent Storyboard.TargetName="EventFire"
                                EventName="AutoContinue"
                                local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Continue}" />
        </TriggerActionCollection>

        <StringAnimationUsingKeyFrames Storyboard.TargetName="BalanceValue"
                                       Storyboard.TargetProperty="(local:BindingProxy.A)"
                                       x:Key="A_Animation_BalanceValue_Tag">
            <DiscreteStringKeyFrame KeyTime="{StaticResource A_KeyTime_TeamScore_SeriesWinner_Begin}"
                                     Value="ShowRoadtripWinner" />
        </StringAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="VideoContainer"
                                       Storyboard.TargetProperty="Opacity"
                                       x:Key="A_Animation_VideoContainer_Opacity">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="1" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_End}"
                                    Value="1" />
            <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Sparkles_Out}"
                                  Value="0" />
        </DoubleAnimationUsingKeyFrames>

        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="Video"
                                       Storyboard.TargetProperty="Tag"
                                       x:Key="A_Animation_Video_Source">
            <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                    Value="SourceNotSet" />
            <DiscreteObjectKeyFrame KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Sparkle}"
                                    Value="SourceSet"/>
            <DiscreteObjectKeyFrame KeyTime="{StaticResource A_KeyTime_TeamScore_Scores_Sparkles_Out}"
                                    Value="SourceNotSet" />
        </ObjectAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                       Storyboard.TargetName="OldScore"
                                       x:Key="A_Animation_OldScore_Opacity">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="1" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_OldScore_AlphaOff_Begin}"
                                    Value="1" />
            <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_OldScore_AlphaOff_End}"
                                  Value="0" />
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                       Storyboard.TargetName="NewScore"
                                       x:Key="A_Animation_NewScore_Opacity">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="0" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_AlphaOn_Begin}"
                                    Value="0" />
            <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_AlphaOn_End}"
                                  Value="1" />
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
                                       Storyboard.TargetName="NewScore"
                                       x:Key="A_Animation_NewScore_ScaleX">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="{StaticResource A_Double_NewScore_Scale}" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_Begin}"
                                    Value="{StaticResource A_Double_NewScore_Scale}" />
            <SplineDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                                  Value="1"
                                  KeySpline="0.9,0.0,0.9,0.0" />
        </DoubleAnimationUsingKeyFrames>
        
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
                                       Storyboard.TargetName="NewScore"
                                       x:Key="A_Animation_NewScore_ScaleY">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="{StaticResource A_Double_NewScore_Scale}" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_Begin}"
                                    Value="{StaticResource A_Double_NewScore_Scale}" />
            <SplineDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_MotionOn_End}"
                                  Value="1"
                                  KeySpline="0.9,0.0,0.9,0.0" />
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Width"
                                       Storyboard.TargetName="TotalGlow"
                                       x:Key="A_Animation_TotalGlow_Width">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="0" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_Begin}"
                                    Value="20" />
            <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_End}"
                                  Value="400"
                                  EasingFunction="{local:LinearEasing EasingMode=EaseOut}" />
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Height"
                                       Storyboard.TargetName="TotalGlow"
                                       x:Key="A_Animation_TotalGlow_Height">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="0" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_Begin}"
                                    Value="0" />
            <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_End}"
                                  Value="900"
                                  EasingFunction="{local:QuadraticEasing EasingMode=EaseOut}" />
        </DoubleAnimationUsingKeyFrames>

        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                       Storyboard.TargetName="TotalGlow"
                                       x:Key="A_Animation_TotalGlow_Opacity">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                    Value="1.5" />
            <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Glow_On_End}"
                                    Value="1.5" />
            <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Alpha_Off_Begin}"
                                  Value="1.3" />
            <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Score_Slam_Alpha_Off_End}"
                                  Value="0" />
        </DoubleAnimationUsingKeyFrames>
        
        <local:UIStoryboard x:Key="A_Storyboard_PostRace_TeamScore"
                            TriggerAnimation="{StaticResource A_TriggerAnimation_TeamScore}">
            <StaticResourceExtension ResourceKey="A_Animation_BalanceValue_Tag" />
            <StaticResourceExtension ResourceKey="A_Animation_VideoContainer_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_Video_Source" />
            <StaticResourceExtension ResourceKey="A_Animation_OldScore_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_ScaleX" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_ScaleY" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Width" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Height" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Opacity" />
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_PostRace_TeamScore_SecondHalfOnly"
                            BeginTime="-0:0:9.2"
                            TriggerAnimation="{StaticResource A_TriggerAnimation_TeamScore_SecondHalf}">
            <StaticResourceExtension ResourceKey="A_Animation_BalanceValue_Tag" />
            <StaticResourceExtension ResourceKey="A_Animation_VideoContainer_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_Video_Source" />
            <StaticResourceExtension ResourceKey="A_Animation_OldScore_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_Opacity" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_ScaleX" />
            <StaticResourceExtension ResourceKey="A_Animation_NewScore_ScaleY" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Width" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Height" />
            <StaticResourceExtension ResourceKey="A_Animation_TotalGlow_Opacity" />
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="WinnerScore"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LoserScore"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TeamScore_Score"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TeamScore_Team"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_Gamertag_Intro">
            <local:UIStoryboard.TriggerAnimation>
                <local:StartAudioTrigger local:TriggerAnimation.KeyTime="0:0:0.2"
                                EventName="/Master/UI/Post Race/UI_PostRace_CashRewardsItemOn" />
            </local:UIStoryboard.TriggerAnimation>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                           Storyboard.TargetName="Arrow">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.4"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                           Storyboard.TargetName="Name">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.3"
                                      Value="1" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.4"
                                      Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)"
                             Storyboard.TargetName="Name">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                        Value="400" />
                <SplineDoubleKeyFrame KeyTime="0:0:0.4"
                                      Value="0"
                                      KeySpline="0.9,0.0,0.9,0.0" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:MotionBlurEffect.MotionBlurPositionXControl)"
                                           Storyboard.TargetName="Name">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="10000" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.4"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <Style x:Key="A_Style_BackgroundDivide" TargetType="Grid">
            <Setter Property="Width"
                    Value="4400" />
            <Setter Property="HorizontalAlignment"
                    Value="Center" />
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <TranslateTransform />
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding TeamID}" Value="1">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard FillBehavior="HoldEnd">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                            Value="-1250" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding TeamID}" Value="0">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard FillBehavior="HoldEnd">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                            Value="1250" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
        
        <local:MappingConverter x:Key="A_Converter_OverlayColour" Default="#cd173d6b">
            <local:MappingConverterEntry Key="0" Value="#cd6d1616" />
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_Roadtrip_WinnerSubString" Default="{local:Loc InGame.IDS_PostRace_AdventureWinners}">
            <local:MappingConverterEntry Key="True" Value="{local:Loc InGame.IDS_PostRace_ChampionshipWinners}"/>
        </local:MappingConverter> 
        
        <Style x:Key="A_Style_Control_PostRace_TotalLabelBlock_TeamScore" TargetType="Control" BasedOn="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}">
            <Setter Property="Tag" Value="{Binding TeamSub}"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="ShowRoadtripWinner">
                    <Setter Property="Tag" Value="{Binding IsChampionship, Converter={StaticResource A_MappingConverter_Roadtrip_WinnerSubString}}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Color x:Key="A_Colour_Red1">#e9002d</Color>
        <Color x:Key="A_Colour_Red2">#df2f90</Color>
        <Color x:Key="A_Colour_Blue1">#1aaade</Color>
        <Color x:Key="A_Colour_Blue2">#0864cb</Color>
        <System:Int32 x:Key="A_Team0">0</System:Int32>
        <System:Int32 x:Key="A_Team1">1</System:Int32>

        <System:Double x:Key="A_Double_Value_Separator">22</System:Double>
        <System:Double x:Key="A_Double_Value_Separator_CHS">40</System:Double>
        <System:Double x:Key="A_Double_Value_Separator_CHT">40</System:Double>
    </Page.Resources>
    <Grid Height="540"
          Width="1920">

        <Grid x:Name="BackgroundDivide"
              Style="{StaticResource A_Style_BackgroundDivide}">
            <UniformGrid Columns="2"
                         RenderTransformOrigin="0.5,0.5">
                <UIElement.RenderTransform>
                    <SkewTransform AngleX="-25" />
                </UIElement.RenderTransform>
                <Grid>
                    <local:FZMaterial Margin="-200,0,0,0">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                                               GradientColorA="{StaticResource A_Colour_Red1}"
                                                               GradientColorB="{StaticResource A_Colour_Red2}"
                                                               GradientAngle="90" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                    <local:FZMaterial Width="75"
                                      Opacity="0.5"
                                      HorizontalAlignment="Right">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                                               GradientColorA="#000824c4"
                                                               GradientColorB="#ff0824c4"
                                                               GradientAngle="90" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
                <Grid>
                    <local:FZMaterial Margin="0,0,-200,0">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                                               GradientColorA="{StaticResource A_Colour_Blue1}"
                                                               GradientColorB="{StaticResource A_Colour_Blue2}"
                                                               GradientAngle="90" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                    <local:FZMaterial Width="75"
                                      Opacity="0.5"
                                      HorizontalAlignment="Left">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                                               GradientColorA="#ff6a002d"
                                                               GradientColorB="#006a002d"
                                                               GradientAngle="90" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
            </UniformGrid>

            <local:FZMaterial Color="#5000"
                              Width="1.5"
                              HorizontalAlignment="Center"
                              RenderTransformOrigin="0.5,0.5">
                <UIElement.RenderTransform>
                    <SkewTransform AngleX="-25" />
                </UIElement.RenderTransform>
            </local:FZMaterial>
        </Grid>

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

        <!-- Content -->
        <Grid Width="878"
              Height="540"
              Margin="80,0,0,0"
              HorizontalAlignment="Left"
              x:Name="Gamerpic"
              Style="{StaticResource A_Style_FrameworkElement_PostRace_SmallAnimatedBlock}"
              local:UIPageTransitionManager.TransitionIndex="0">
            <Grid.Resources>
                <DataTemplate x:Key="A_Template_TeamGamerPics">
                    <Grid>
                        <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_PostRace_Gamerpic}"
                                          Height="270.25"
                                          Width="270"
                                          ClipToBounds="True"
                                          VerticalAlignment="Center"
                                          HorizontalAlignment="Center"
                                          x:Name="Pic"
                                          Margin="0,0,-0.5,-0.5"
                                          GreedyMeasure="True"
                                          ImageSource="{Binding Converter={StaticResource A_GamerPicOrTeamProfileConverter}, ConverterParameter={StaticResource A_Size_PostRace_GamerPicSizeParams}}"
                                          Stretch="UniformToFill" />
                    </Grid>
                    <DataTemplate.Triggers>
                        <DataTrigger Binding="{Binding ItemsSource.Count, RelativeSource={RelativeSource AncestorType=ItemsControl}}"
                                     Value="1">
                            <Setter TargetName="Pic"
                                    Property="Height"
                                    Value="878" />
                            <Setter TargetName="Pic"
                                    Property="Width"
                                    Value="878" />
                        </DataTrigger>
                    </DataTemplate.Triggers>
                </DataTemplate>
                
                <ItemsPanelTemplate x:Key="A_Template_GamerPicsPanel">
                    <WrapPanel IsItemsHost="True" Orientation="Vertical" />
                </ItemsPanelTemplate>

                <Style TargetType="ItemsControl"
                       x:Key="A_Style_GamerPics">
                    <Setter Property="ItemTemplate"
                            Value="{StaticResource A_Template_TeamGamerPics}" />
                    <Setter Property="ItemsPanel"
                            Value="{StaticResource A_Template_GamerPicsPanel}" />
                    <Setter Property="Tag">
                        <Setter.Value>
                            <TranslateTransform X="0" />
                        </Setter.Value>
                    </Setter>
                    <Setter Property="UIElement.RenderTransform"
                            Value="{Binding Tag, RelativeSource={RelativeSource Self}}" />

                    <Style.Triggers>
                        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
                            <local:BeginUIStoryboard>
                                <local:UIStoryboard RepeatBehavior="Forever">
                                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Tag).(TranslateTransform.X)">
                                        <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                                Value="0" />
                                        <EasingDoubleKeyFrame KeyTime="0:0:6"
                                                                Value="-540" 
                                                              EasingFunction="{local:LinearEasing}"/>
                                    </DoubleAnimationUsingKeyFrames>
                                </local:UIStoryboard>
                            </local:BeginUIStoryboard>
                        </EventTrigger>
                        <DataTrigger Binding="{Binding Items.Count, RelativeSource={RelativeSource Self}}"
                                     Value="1">
                            <Setter Property="UIElement.RenderTransform">
                                <Setter.Value>
                                    <!-- This unbinds the render transform from Tag, stopping it from animating when only 1 player -->
                                    <TranslateTransform X="0" />
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Grid.Resources>
            <local:FZMaterial OpacityMask="{StaticResource A_Brush_GamerpicOpacity}">
                <Grid>
                    <Grid Height="540"
                          Width="878"
                          ClipToBounds="True">
                        <ItemsControl Style="{StaticResource A_Style_GamerPics}"
                                      ItemsSource="{Binding LoopTeamProfiles}">
                        </ItemsControl>
                    </Grid>
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/PostRace/Gamerpic_Vignette.png" />
                </Grid>
            </local:FZMaterial>
        </Grid>

        <Decorator HorizontalAlignment="Right"
                   VerticalAlignment="Center"
                   Margin="0,50,0,0"
                   Width="1000">
            <local:ZPanel.Transform>
                <local:ZRotation Angle="-6" />
            </local:ZPanel.Transform>
            <StackPanel Orientation="Vertical"
                        MaxWidth="900"
                        HorizontalAlignment="Center"
                        RenderTransform="{StaticResource A_Transform_Italic}">
                <Control x:Name="TotalLabel"
                         Margin="50,0,0,0"
                         Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}"
                         MinHeight="43"
                         Tag="{Binding TeamHeader, Converter={StaticResource A_StringToUpper}}">
                    <Control.Resources>

                        <Style x:Key="A_Style_FZTextBlock_PostRace_TotalText"
                               TargetType="local:FZTextBlock"
                               BasedOn="{StaticResource A_Style_FZTextBlock_PostRace_TotalText}">
                            <Setter Property="FontFamily"
                                    Value="Horizon_B" />
                        </Style>

                    </Control.Resources>
                </Control>

                <Decorator Height="22" />

                <Control x:Name="TotalValue"
                         Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                         Tag="{Binding TeamName, Converter={StaticResource A_StringToUpper}}" />

                <Decorator Height="{local:LocalizedResource A_Double_Value_Separator}" />

                <Control x:Name="BalanceValue"
                         Margin="0,0,40,0"
                         HorizontalAlignment="Right"
                         local:BindingProxy.A="ShowTeamWinner"
                         Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock_TeamScore}"/>
            </StackPanel>
        </Decorator>

        <Decorator local:ZPanel.TransformOrigin="0.5,0.5">
            <local:ZPanel.Transform>
                <local:ZRotation Angle="-6" />
            </local:ZPanel.Transform>

            <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
                <Decorator RenderTransform="{StaticResource A_Transform_Italic}">
                    <Control x:Name="TeamScore_Team"
                             Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}"
                             MinHeight="43"
                             HorizontalContentAlignment="Center"
                             Tag="{local:Loc InGame.IDS_PostRace_TeamScoreLine1}">
                        <Control.Resources>

                            <Style x:Key="A_Style_FZTextBlock_PostRace_TotalText"
                                   TargetType="local:FZTextBlock"
                                   BasedOn="{StaticResource A_Style_FZTextBlock_PostRace_TotalText}">
                                <Setter Property="FontFamily"
                                        Value="Horizon_B" />
                            </Style>

                        </Control.Resources>
                    </Control>
                </Decorator>
                
                <Decorator Height="8" />

                <Decorator RenderTransform="{StaticResource A_Transform_Italic}">
                    <Control x:Name="TeamScore_Score"
                             Margin="0,0,40,0"
                             HorizontalContentAlignment="Center"
                             Style="{StaticResource A_Style_Control_PostRace_TotalLabelBlock}"
                             Tag="{local:Loc InGame.IDS_PostRace_TeamScoreLine2}" />
                </Decorator>
            </StackPanel>
            
        </Decorator>

        <!--Team series scores elements-->
        <Grid>
            <Grid.Resources>
                <local:MappingConverter x:Key="A_Converter_WinnerGridRef" Default="2">
                    <local:MappingConverterEntry Key="0" Value="0" />
                </local:MappingConverter>
                <local:MappingConverter x:Key="A_Converter_LoserGridRef" Default="0">
                    <local:MappingConverterEntry Key="0" Value="2" />
                </local:MappingConverter>
                <local:MappingConverter x:Key="A_Converter_WinnerScoreDock" Default="Left">
                    <local:MappingConverterEntry Key="0" Value="Right" />
                </local:MappingConverter>
                <local:MappingConverter x:Key="A_Converter_LoserScoreDock" Default="Right">
                    <local:MappingConverterEntry Key="0" Value="Left" />
                </local:MappingConverter>
                <local:MappingConverter x:Key="A_Converter_WinnerScoreOrigin" Default="0.1,0.5">
                    <local:MappingConverterEntry Key="0" Value="0.9,0.5" />
                </local:MappingConverter>
                <local:MappingConverter x:Key="A_Converter_LoserScoreOrigin" Default="0.9,0.5">
                    <local:MappingConverterEntry Key="0" Value="0.1,0.5" />
                </local:MappingConverter>

                <local:MappingConverter x:Key="A_Converter_VideoOffset" Default="400">
                    <local:MappingConverterEntry Key="0" Value="-400" />
                </local:MappingConverter>
            </Grid.Resources>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="400"/>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Decorator local:ZPanel.TransformOrigin="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreOrigin}}"
                       Grid.Column="{Binding TeamID, Converter={StaticResource A_Converter_LoserGridRef}}">
                <local:ZPanel.Transform>
                    <local:ZRotation Angle="-6" />
                </local:ZPanel.Transform>

                <Decorator RenderTransform="{StaticResource A_Transform_Italic}"
                           HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreDock}}">
                    <DockPanel x:Name="LoserScore"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                Style="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock}">
                        <Control DockPanel.Dock="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreDock}}"
                                 Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                 Opacity="1"
                                 Margin="20,0"
                                 Tag="{Binding LosingScore}">
                            <Control.Resources>
                                <System:Double x:Key="A_Double_TeamNameLabelCapHeight">180</System:Double>
                            </Control.Resources>
                        </Control>
                        <Viewbox HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreDock}}"
                            MaxHeight="{StaticResource A_Double_ScoreHeaderAndName_MaxHeight}"
                            MaxWidth="{StaticResource A_Double_ScoreHeaderAndName_MaxWidth}">
                            <StackPanel Orientation="Vertical">
                                <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                         HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreDock}}"
                                         Opacity="1"
                                         Tag="{Binding ScoreLosingTeamHeader, Converter={StaticResource A_StringToUpper}}">
                                    <Control.Resources>
                                        <System:Double x:Key="A_Double_TeamNameLabelCapHeight">82</System:Double>
                                    </Control.Resources>
                                </Control>
                                <Decorator Height="{local:LocalizedResource A_Double_ScoreHeaderAndName_SpacerHeight}"/>
                                <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                         HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_LoserScoreDock}}"
                                         Opacity="1"
                                         Tag="{Binding ScoreLosingTeamName, Converter={StaticResource A_StringToUpper}}">
                                    <Control.Resources>
                                        <System:Double x:Key="A_Double_TeamNameLabelCapHeight">82</System:Double>
                                    </Control.Resources>
                                </Control>
                            </StackPanel>
                        </Viewbox>
                    </DockPanel>
                </Decorator>

            </Decorator>

            <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetAdditive}"
                              CaptureSubgraph="True"
                              HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                              Width="1920"
                              Height="540"
                              Margin="-400,0"
                              Grid.Column="{Binding TeamID, Converter={StaticResource A_Converter_WinnerGridRef}}"
                              Visibility="{Binding FinalEvent, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}"
                              x:Name="VideoContainer">
                <Grid Width="1920"
                      Height="540"
                      ClipToBounds="True">
                    <MediaElement local:FzMediaElementExtension.Loop="False"
                                  Tag="SourceNotSet"
                                  LoadedBehavior="Stop"
                                  UnloadedBehavior="Stop"
                                  Margin="-350,0"
                                  Width="1920"
                                  Height="540"
                                  HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                  Stretch="UniformToFill"
                                  x:Name="Video">
                        <FrameworkElement.Style>
                            <Style TargetType="MediaElement">
                                <Style.Triggers>
                                    <Trigger Property="Tag"
                                             Value="SourceSet">
                                        <Trigger.Setters>
                                            <Setter Property="Source"
                                                    Value="game:/Media/UI/Videos/Stars_Particles.bk2" />
                                        </Trigger.Setters>
                                    </Trigger>
                                </Style.Triggers>
                            </Style>
                        </FrameworkElement.Style>
                    </MediaElement>
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                Margin="-350,0"
                                RenderTransformOrigin="0.5,0.5">
                        <UIElement.RenderTransform>
                            <SkewTransform AngleX="-25" />
                        </UIElement.RenderTransform>
                        <local:FZMaterial Width="75">
                            <local:FZMaterial.Preset>
                                <local:FZMaterialPresetRoundtangle GradientAngle="90"
                                                                   GradientColorA="#0fff"
                                                                   GradientColorB="#ffff"
                                                                   AlphaMode="Cutout"/>
                            </local:FZMaterial.Preset>
                        </local:FZMaterial>
                        <local:FZMaterial DockPanel.Dock="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                          Width="400"
                                          Margin="-0.5,0">
                            <local:FZMaterial.Preset>
                                <local:FZMaterialPreset AlphaMode="Cutout" />
                            </local:FZMaterial.Preset>
                        </local:FZMaterial>
                        <local:FZMaterial DockPanel.Dock="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                          Width="75">
                            <local:FZMaterial.Preset>
                                <local:FZMaterialPresetRoundtangle GradientAngle="90"
                                                                   GradientColorA="#ffff"
                                                                   GradientColorB="#0fff"
                                                                   AlphaMode="Cutout" />
                            </local:FZMaterial.Preset>
                        </local:FZMaterial>
                    </StackPanel>

                </Grid>
            </local:FZMaterial>

            <Decorator local:ZPanel.TransformOrigin="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreOrigin}}"
                       Grid.Column="{Binding TeamID, Converter={StaticResource A_Converter_WinnerGridRef}}">
                <local:ZPanel.Transform>
                    <local:ZRotation Angle="-6" />
                </local:ZPanel.Transform>

                <Decorator RenderTransform="{StaticResource A_Transform_Italic}"
                           HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}">
                    <DockPanel x:Name="WinnerScore"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center"
                               Style="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock}">
                        <Grid DockPanel.Dock="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}">
                            <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                     Opacity="1"
                                     Margin="20,0"
                                     Tag="{Binding OldScore}"
                                     x:Name="OldScore">
                                <Control.Resources>
                                    <System:Double x:Key="A_Double_TeamNameLabelCapHeight">180</System:Double>
                                </Control.Resources>
                            </Control>
                            <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                     Margin="20,0"
                                     Tag="{Binding Score}"
                                     x:Name="NewScore"
                                     RenderTransformOrigin="0.5,0.5">
                                <Control.RenderTransform>
                                    <ScaleTransform />
                                </Control.RenderTransform>
                                <Control.Resources>
                                    <System:Double x:Key="A_Double_TeamNameLabelCapHeight">180</System:Double>
                                </Control.Resources>
                            </Control>

                            <Canvas HorizontalAlignment="Center"
                                    VerticalAlignment="Center">
                                <Decorator Width="0"
                                           Height="0">
                                    <local:FZMaterial x:Name="TotalGlow"
                                                      RenderTransformOrigin="0.5, 0.5"
                                                      HorizontalAlignment="Center"
                                                      VerticalAlignment="Center"
                                                      Height="900"
                                                      Width="0"
                                                      Opacity="1.5"
                                                      Color="#FFFFFF"
                                                      Preset="{StaticResource A_FZMaterialPresetAdditive}"
                                                      ImageSource="/ForzaUI;component/Textures/Anthem/HUD/SkillsLargeGlow.png"
                                                      local:ZPanel.DisableClipping="True">
                                        <local:FZMaterial.RenderTransform>
                                            <ScaleTransform />
                                        </local:FZMaterial.RenderTransform>
                                    </local:FZMaterial>
                                </Decorator>
                            </Canvas>
                        </Grid>
                        <Viewbox HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                            MaxHeight="{StaticResource A_Double_ScoreHeaderAndName_MaxHeight}"
                            MaxWidth="{StaticResource A_Double_ScoreHeaderAndName_MaxWidth}">
                            <StackPanel Orientation="Vertical">
                                <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                         HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                         Opacity="1"
                                         Tag="{Binding ScoreTeamHeader, Converter={StaticResource A_StringToUpper}}">
                                    <Control.Resources>
                                        <System:Double x:Key="A_Double_TeamNameLabelCapHeight">82</System:Double>
                                    </Control.Resources>
                                </Control>
                                <Decorator Height="{local:LocalizedResource A_Double_ScoreHeaderAndName_SpacerHeight}"/>
                                <Control Style="{StaticResource A_Style_Control_PostRace_TeamNameBlock}"
                                         HorizontalAlignment="{Binding TeamID, Converter={StaticResource A_Converter_WinnerScoreDock}}"
                                         Opacity="1"
                                         Tag="{Binding ScoreTeamName, Converter={StaticResource A_StringToUpper}}">
                                    <Control.Resources>
                                        <System:Double x:Key="A_Double_TeamNameLabelCapHeight">82</System:Double>
                                    </Control.Resources>
                                </Control>
                            </StackPanel>
                        </Viewbox>
                    </DockPanel>
                </Decorator>


            </Decorator>
        </Grid>

        <!-- Team lineup -->
        <Decorator Style="{StaticResource A_Style_FrameworkElement_PostRace_TotalLabelBlock}"
                   Width="1920"
                   Height="540"
                   ClipToBounds="True"
                   x:Name="LineupGamerpics">
            <Grid HorizontalAlignment="Center">
                <Grid.Resources>
                    <System:Double x:Key="A_Double_GamertagHeight">40</System:Double>

                    <local:MappingConverter x:Key="A_Converter_LocalPlayerColour"
                                            Default="#fff">
                        <local:MappingConverterEntry Key="True"
                                                     Value="#ffff38" />
                    </local:MappingConverter>
                    
                    <Style x:Key="A_Style_FZTextBlock_Gamertag_Team"
                           TargetType="local:FZTextBlock"
                           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
                        <Setter Property="Color"
                                Value="{Binding IsLocal, Converter={StaticResource A_Converter_LocalPlayerColour}}" />
                        <Setter Property="CapHeight"
                                Value="{StaticResource A_Double_GamertagHeight}" />
                    </Style>

                    <Style x:Key="A_Style_FZTextBlock_Gamertag"
                           TargetType="local:FZTextBlock"
                           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                        <Setter Property="Color"
                                Value="{Binding IsLocal, Converter={StaticResource A_Converter_LocalPlayerColour}}" />
                        <Setter Property="CapHeight"
                                Value="{StaticResource A_Double_GamertagHeight}" />
                    </Style>

                    <DataTemplate x:Key="A_Template_TeamGamerPics">
                        <Grid RenderTransformOrigin="0.5,0.5">
                            <UIElement.RenderTransform>
                                <SkewTransform AngleX="-25" />
                            </UIElement.RenderTransform>
                            <local:FZMaterial Width="220"
                                              CaptureSubgraph="True"
                                              ClipToBounds="True"
                                              VerticalAlignment="Center"
                                              HorizontalAlignment="Center"
                                              Margin="16,0">
                                <Grid Width="220"
                                      ClipToBounds="True">
                                    <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_PostRace_Gamerpic}"
                                                      VerticalAlignment="Center"
                                                      HorizontalAlignment="Center"
                                                      RenderTransformOrigin="0.5,0.5"
                                                      GreedyMeasure="True"
                                                      ImageSource="{Binding UserProfile, Converter={StaticResource A_GamerPicOrTeamProfileConverter}, ConverterParameter={StaticResource A_Size_PostRace_GamerPicSizeParams}}"
                                                      Stretch="UniformToFill">
                                        <UIElement.RenderTransform>
                                            <SkewTransform AngleX="25" />
                                        </UIElement.RenderTransform>
                                    </local:FZMaterial>
                                    <!-- This might need a custom gradient supplied in texture form -->
                                    <Grid Opacity="0.3"
                                          Width="220"
                                          Height="540">
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition />
                                            <ColumnDefinition Width="0" />
                                            <ColumnDefinition />
                                        </Grid.ColumnDefinitions>
                                        <local:FZMaterial Grid.Column="0">
                                            <local:FZMaterial.Preset>
                                                <local:FZMaterialPresetRoundtangle GradientAngle="90"
                                                                                   GradientColorA="#f000"
                                                                                   GradientColorB="#0000" />
                                            </local:FZMaterial.Preset>
                                        </local:FZMaterial>
                                        <local:FZMaterial Grid.Column="2">
                                            <local:FZMaterial.Preset>
                                                <local:FZMaterialPresetRoundtangle GradientAngle="90"
                                                                                   GradientColorA="#0000"
                                                                                   GradientColorB="#f000" />
                                            </local:FZMaterial.Preset>
                                        </local:FZMaterial>

                                        <local:FZMaterial Grid.ColumnSpan="3"
                                                          Color="{Binding TeamID, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_OverlayColour}}" />
                                    </Grid>
                                </Grid>
                            </local:FZMaterial>

                            <Canvas HorizontalAlignment="Center"
                                    VerticalAlignment="Bottom">
                                <Decorator RenderTransformOrigin="0,0.6">
                                    <UIElement.RenderTransform>
                                        <TransformGroup>
                                            <StaticResourceExtension ResourceKey="A_Transform_Italic" />
                                            <RotateTransform Angle="-65" />
                                            <SkewTransform AngleX="25" />
                                        </TransformGroup>
                                    </UIElement.RenderTransform>
                                    <StackPanel Orientation="Horizontal">
                                        <Decorator Width="70" />
                                        <local:FZMaterial Width="20"
                                                          x:Name="Arrow"
                                                          Opacity="0"
                                                          Color="{Binding IsLocal, Converter={StaticResource A_Converter_LocalPlayerColour}}">
                                            <local:FZMaterial.Data>
                                                <local:FZGeometry Data="M0,0 L1,-1, 1,1" />
                                            </local:FZMaterial.Data>
                                        </local:FZMaterial>
                                        <StackPanel Orientation="Horizontal"
                                                    Effect="{StaticResource A_MotionBlurEffect}"
                                                    Opacity="0"
                                                    x:Name="Name">
                                            <UIElement.RenderTransform>
                                                <TranslateTransform />
                                            </UIElement.RenderTransform>
                                            <Decorator Width="14" />
                                            <StackPanel Orientation="Horizontal"
                                                        Visibility="{Binding UserProfile.FormattedClubTag, Converter={StaticResource A_StringVisConverter}}">
                                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Gamertag_Team}">
                                                    <local:FZRun Text="{Binding UserProfile.FormattedClubTag}" />
                                                </local:FZTextBlock>
                                            </StackPanel>
                                            <Decorator Width="10" />
                                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}"
                                                               Style="{StaticResource A_Style_FZTextBlock_Gamertag}" />
                                        </StackPanel>
                                    </StackPanel>
                                </Decorator>
                            </Canvas>
                        </Grid>
                    </DataTemplate>

                    <ItemsPanelTemplate x:Key="A_Template_GamerPicsPanel">
                        <StackPanel IsItemsHost="True"
                                   Orientation="Horizontal" />
                    </ItemsPanelTemplate>

                    <Style TargetType="ItemsControl"
                           x:Key="A_Style_GamerPics">
                        <Setter Property="ItemTemplate"
                                Value="{StaticResource A_Template_TeamGamerPics}" />
                        <Setter Property="ItemsPanel"
                                Value="{StaticResource A_Template_GamerPicsPanel}" />
                    </Style>
                </Grid.Resources>
                <ItemsControl Style="{StaticResource A_Style_GamerPics}"
                              ItemsSource="{Binding TeamProfiles}"
                              x:Name="GamerpicsItemsControl"/>
            </Grid>
            <local:EventFire.FzTriggers>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag0"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[0]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag1"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[1]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag2"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[2]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag3"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[3]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag4"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[4]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
                <local:BeginUIStoryboard local:EventFireTrigger.Event="tag5"
                                         local:EventFireTrigger.TargetName="GamerpicsItemsControl[5]"
                                         Storyboard="{StaticResource A_Storyboard_Gamertag_Intro}">
                </local:BeginUIStoryboard>
            </local:EventFire.FzTriggers>
        </Decorator>

        <local:FZMaterial Color="#000000"
                          Opacity="0.3"
                          Height="27"
                          VerticalAlignment="Bottom" />
        <local:FZMaterial Color="#000000"
                          Opacity="0.3"
                          Height="27"
                          VerticalAlignment="Top" />

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

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

        <Decorator x:Name="TeamScoresComplete">
            <Decorator.Resources>
                <local:EventFireTriggerCollection x:Key="avoidFalsePositiveParserError">
                    <local:BeginUIStoryboard local:EventFireTrigger.Event="TeamScoresComplete">
                        <local:UIStoryboard>
                            <local:UIStoryboard.TriggerAnimation>
                                <local:RaiseFzEvent local:TriggerAnimation.KeyTime="0:0:2"
                                                    Storyboard.TargetName="EventFire"
                                                    EventName="Complete" />
                                <local:RaiseFzEvent local:TriggerAnimation.KeyTime="0:0:2"
                                                    Storyboard.TargetName="EventFire"
                                                    EventName="AutoContinue" />
                            </local:UIStoryboard.TriggerAnimation>
                        </local:UIStoryboard>
                    </local:BeginUIStoryboard>
                </local:EventFireTriggerCollection>
            </Decorator.Resources>
            <Decorator.Style>
                <Style>
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding FinalEvent}"
                                     Value="False">
                            <Setter Property="local:EventFire.FzTriggers"
                                    Value="{StaticResource avoidFalsePositiveParserError}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </Decorator.Style>
        </Decorator>

    </Grid>
    <local:EventFire.FzTriggers>
        <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_PostRace_TeamScore}"
                                 local:EventFireTrigger.Event="StartPanelAnimation" />
        <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_PostRace_TeamScore_SecondHalfOnly}"
                                 local:EventFireTrigger.Event="StartSecondHalfOnlyPanelAnimation" />
    </local:EventFire.FzTriggers>
</Page>
