<Page DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.A_EliminatorAnnouncement"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      x:Name="Page">

    <Page.Resources>
            <KeyTime x:Key="A_KeyTime_Shown_To_Hidden_Time">0:0:0.24</KeyTime>
            <ImageBrush x:Key="A_Brush_TileBackgroundOpacityMask" ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPatternMask.png"/>

            <Style TargetType="{x:Type local:FZRun}"
                       x:Key="A_Style_Run_EliminatorAnnouncement_Tape_BOLD">
                <Setter Property="FontFamily"
                            Value="Horizon_A" />
            </Style>

             <String x:Key="A_String_Format_Narration">{0} . {1} {2}</String>

            <Style x:Key="A_Style_FZTextBlock_TextLine_Base" TargetType="local:FZTextBlock">
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="FontFamily" Value="Horizon_A"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_FirstLine" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TextLine_Base}">
                <Setter Property="CapHeight" Value="35"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_SecondLine" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TextLine_Base}">
                <Setter Property="CapHeight" Value="126"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_TapeLine" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TextLine_Base}">
                <Setter Property="CapHeight" Value="35"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_Run_EliminatorAnnouncement_Tape_"/>
                <Setter Property="FontFamily"  Value="Horizon_B" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding AnnouncementContext}" Value="{x:Static local:EliminatorAnnouncementContext.WinGame}">
                        <Setter Property="Color" Value="#BF000000"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_Converter_AnnouncementContext_To_ImagePath" Default="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/Pink_Banner.png">
                <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.WinGame}" Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/GoldBanner.png"/>
            </local:MappingConverter>
            
            <Style x:Key="A_Style_FZMaterial_BackgroundBranding" TargetType="local:FZMaterial">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPattern.png"/>
                <Setter Property="Height" Value="1024"/>
                <Setter Property="Width" Value="1362"/>
                <Setter Property="TextureWrap" Value="True"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding AnnouncementContext}" Value="{x:Static local:EliminatorAnnouncementContext.WinGame}">
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPatternGold.png"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>


        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_Begin"
                             KeyTime="0:0:0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_Land"
                             KeyTime="0:0:0.36" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_Slide_End"
                             KeyTime="0:0:5" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_Fade_End"
                             KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                             Offset="-0:0:1.0" />
        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_Fade_Start"
                             KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                             Offset="-0:0:0.3"/>

        <local:UIStoryboard x:Key="A_Storyboard_HighContrastBg">
            <!-- High Contrast BG fade in/out -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="HighContrastBg"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="1" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                        Value="1" />
                <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_LoopingAnimatedBackground" Duration="1:0:0">
            <DoubleAnimation Storyboard.TargetName="AnimatedContent" RepeatBehavior="Forever" Duration="0:0:20"
                             From="2" To="-2"
                             Storyboard.TargetProperty="(local:FZMaterial.ImageTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)">
            </DoubleAnimation>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_FadeOut" FillBehavior="HoldEnd" >
            <!-- Fade off -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="AnimatedBackground"
                                           Storyboard.TargetProperty="Opacity">
                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.15"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           Storyboard.TargetProperty="Opacity">
                <EasingDoubleKeyFrame Value="0"  KeyTime="0:0:0.15"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           Storyboard.TargetProperty="Opacity">
                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.15"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           Storyboard.TargetProperty="Opacity">
                <EasingDoubleKeyFrame Value="0" KeyTime="0:0:0.15"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <local:UIStoryboard.TriggerAnimation>
                <local:RaiseFzEvent EventName="FadeOutComplete" local:TriggerAnimation.KeyTime="0:0:0.15"/>
            </local:UIStoryboard.TriggerAnimation>
        </local:UIStoryboard>

        <local:OffsetKeyTime x:Key="A_KeyTime_Announcement_BackgroundFade_Start"
                             Offset="0:0:0.14"
                             KeyTime="{StaticResource A_KeyTime_Announcement_Land}"/>

        <local:UIStoryboard x:Key="A_Storyboard_FadeIn" FillBehavior="HoldEnd">
            <!-- Fade on-->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="AnimatedBackground"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_BackgroundFade_Start}"
                                      Value="1"
                                      EasingFunction="{local:LinearEasing}" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="1"
                                      EasingFunction="{local:LinearEasing}" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="1"
                                      EasingFunction="{local:LinearEasing}" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="1"
                                      EasingFunction="{local:LinearEasing}" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <local:UIStoryboard.TriggerAnimation>
                <local:RaiseFzEvent local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Fade_Start}"
                                    EventName="AnnouncementReadyToExit" />
            </local:UIStoryboard.TriggerAnimation>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_AnimationUsingKeyFrames_Whoosh">
            <!-- Whoosh -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="70"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="50"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="-2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="-2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="30"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_Animate_GameText_Common">
            <StaticResourceExtension ResourceKey="A_Storyboard_AnimationUsingKeyFrames_Whoosh"/>

            <!-- Slide -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="-60" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="-2" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="60" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>




        <local:UIStoryboard x:Key="A_Storyboard_AnimationUsingKeyFrames_Whoosh_TwoString">
            <!-- Whoosh -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="-100"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="110"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="-2000" />
                <DiscreteDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                        Value="-2000" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Land}"
                                      Value="-20"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseInOut}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:UIStoryboard x:Key="A_Storyboard_Animate_GameText_TwoStrings">
            <StaticResourceExtension ResourceKey="A_Storyboard_AnimationUsingKeyFrames_Whoosh_TwoString"/>

            <!-- Slide -->
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TopLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="200" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BottomLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="-80" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="TapeLine"
                                           IsAdditive="True"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <EasingDoubleKeyFrame Value="80" KeyTime="{StaticResource A_KeyTime_Announcement_Slide_End}"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>
        
        <local:OffsetKeyTime x:Key="A_KeyTime_SheenMidPoint"
                             KeyTime="0:0:0.20" />
        <local:OffsetKeyTime x:Key="A_KeyTime_SheenEnd"
                             KeyTime="0:0:0.4" />
        <local:UIStoryboard x:Key="A_Storyboard_Animate_WinnerSheen" FillBehavior="HoldEnd">
            <DoubleAnimationUsingKeyFrames Duration="0:0:1.0" Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Sheen">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0" />
                <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_SheenMidPoint}"  Value="0.65" />
                <LinearDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_SheenEnd}" Value="0.0" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Sheen"
                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="-250" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_SheenMidPoint}"
                                      Value="500"
                                      EasingFunction="{local:LinearEasing}" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_SheenEnd}"
                                      Value="1150"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <local:MappingConverter x:Key="A_MappingConverter_Use_Default_Sound_for_AnnouncementContext" Default="{StaticResource A_Boolean_True}">
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.WinGame}" Value="{StaticResource A_Boolean_False}"/>
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.LoseGame}" Value="{StaticResource A_Boolean_False}"/>
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.FinalRace}" Value="{StaticResource A_Boolean_False}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_Use_Default_Slide_for_AnnouncementContext" Default="{StaticResource A_Boolean_True}">
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.PreGame}" Value="{StaticResource A_Boolean_False}"/>
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.FinalRace}" Value="{StaticResource A_Boolean_False}"/>
        </local:MappingConverter>

        <Style x:Key="A_Style_Triggers_For_Context" TargetType="FrameworkElement">
            <Style.Triggers>
                <!-- play default sound if not special announcement-->
                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page},
                    Converter={StaticResource A_MappingConverter_Use_Default_Sound_for_AnnouncementContext}}" Value="{StaticResource A_Boolean_True}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                                                 EventName="/Master/UI/PostRace/HZ2_SFX_HUD_PostRace_CashRewardsTotalOn_01"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>

                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:EliminatorAnnouncementContext.WinGame}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_ELM_Versus_Winner"/>
                        <local:RaiseFzEvent EventName="Play_WinnerSheen"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:EliminatorAnnouncementContext.LoseGame}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_ELM_Versus_Eliminated"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:EliminatorAnnouncementContext.FinalRace}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_ELM_Versus_AppearFinalRound"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>

                <!-- Trigger default intro animation for context-->
                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}, 
                                      Converter={StaticResource A_MappingConverter_Use_Default_Slide_for_AnnouncementContext}}" Value="{StaticResource A_Boolean_True}">
                    <DataTrigger.EnterActions>
                        <local:RaiseFzEvent local:TriggerAnimation.KeyTime="0:0:0.0" EventName="Play_CommonTextEnterAnimation"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>

                <!-- Trigger custom intro animations for non-default context-->
                <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}, 
                    Converter={StaticResource A_MappingConverter_Use_Default_Slide_for_AnnouncementContext}}" Value="{StaticResource A_Boolean_False}">
                    <DataTrigger.EnterActions>
                        <local:RaiseFzEvent local:TriggerAnimation.KeyTime="0:0:0.0" EventName="Play_CustomTextEnterAnimation"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Page.Resources>
    <Grid>
        <local:FZMaterial x:Name="HighContrastBg"
                          Color="#99000000"
                          Visibility="{StaticResource A_Visibility_ShowForHighContrastOnly}" />

        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <local:ControllerButtonPanel x:Name="HelpPanel"
                                         Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A"
                                               Description="{Binding PrimaryDescription}" />
                <local:ControllerButtonControl Button="B"
                                               Description="{Binding SecondaryDescription}" />
                <local:ControllerButtonControl Button="X"
                                               Description="{Binding TertiaryDescription}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.A}"
                                Command="{Binding PrimaryCommand}" />
        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.B}"
                                Command="{Binding SecondaryCommand}" />
        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.X}"
                                Command="{Binding TertiaryCommand}" />

        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}" Margin="-200,140,0,240">
            <local:FZMaterial x:Name="AnimatedBackground" OpacityMask="{StaticResource A_Brush_TileBackgroundOpacityMask}" Color="#00000000" 
                              Width="1362" Height="470" Stretch="Uniform" ClipToBounds="True" Opacity="1" Margin="84,0,0,16">
                <local:FZMaterial x:Name="AnimatedContent"  VerticalAlignment="Center" HorizontalAlignment="Center" RenderTransformOrigin="0.5,0.5"
                                Style="{StaticResource A_Style_FZMaterial_BackgroundBranding}" Opacity="0.5">
                    <local:FZMaterial.ImageTransform>
                        <TransformGroup>
                            <TranslateTransform />
                        </TransformGroup>
                    </local:FZMaterial.ImageTransform>
                    <local:FZMaterial.RenderTransform>
                        <TransformGroup>
                            <SkewTransform AngleX="-45"/>
                            <TranslateTransform/>
                            <RotateTransform />
                        </TransformGroup>
                    </local:FZMaterial.RenderTransform>
                </local:FZMaterial>
            </local:FZMaterial>
            <Grid   VerticalAlignment="Center" 
                    HorizontalAlignment="Center" 
                    RenderTransformOrigin="0.5,0.5"
                    local:MultiStringFormatter.Param0="{Binding TopLine}"
                    local:MultiStringFormatter.Param1="{Binding BottomLine}"   
                    local:MultiStringFormatter.Param2="{Binding ExtremeBottomLine}"
                    local:MultiStringFormatter.Format="{StaticResource A_String_Format_Narration}"
                    local:ScreenReader.LineType="ScreenDescription"
                    local:ScreenReader.Event="OnChange"                    
                    local:ScreenReader.Line="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <SkewTransform AngleX="-8"/>
                        <RotateTransform Angle="-6.3"/>
                        <TranslateTransform Y="-6"/>
                    </TransformGroup>
                </Grid.RenderTransform>

                <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                    <Decorator x:Name="TopLine"
                           Margin="70,0,0,0"
                           Effect="{StaticResource A_MotionBlurEffect}"
                           local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                           Opacity="1">
                        <UIElement.RenderTransform>
                            <TranslateTransform />
                        </UIElement.RenderTransform>
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_FirstLine}" Text="{Binding TopLine}"  Margin="0,0,0,0"/>
                    </Decorator>

                    <Decorator x:Name="BottomLine"
                           Effect="{StaticResource A_MotionBlurEffect}"
                           local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                           RenderTransformOrigin="0.5,0.5"
                           Opacity="1">
                        <UIElement.RenderTransform>
                            <TranslateTransform />
                        </UIElement.RenderTransform>

                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_SecondLine}" Text="{Binding BottomLine}"  Margin="0,12,0,0"/>
                    </Decorator>

                    <Decorator x:Name="TapeLine"
                           Effect="{StaticResource A_MotionBlurEffect}"
                           local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                           RenderTransformOrigin="0.5,0.5"
                           Opacity="1">
                        <UIElement.RenderTransform>
                            <TranslateTransform />
                        </UIElement.RenderTransform>
                        <Grid Margin="0,12,0,0">
                            <local:FZMaterial ImageSourceNoPreload="{Binding AnnouncementContext, Converter={StaticResource A_Converter_AnnouncementContext_To_ImagePath}}" HorizontalAlignment="Center" MinWidth="750" MaxWidth="1150" Height="52">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TapeLine}" MaxWidth="950" local:TextBlockInlineMarkup.Markup="{Binding ExtremeBottomLine}" Margin="120,6"/>
                            </local:FZMaterial>
                        </Grid>
                    </Decorator>
                </StackPanel>

                <local:FZMaterial x:Name="Sheen" Opacity="0" Margin="0,-12" HorizontalAlignment="Left" 
                                  Width="250" Height="350"
                                  RenderTransformOrigin="0.5,0.5"
                                  ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Rivals/ElipseGlow.png" Preset="{StaticResource A_FZMaterialPresetAdditive}" >
                    <UIElement.RenderTransform>
                        <TranslateTransform  X="-250"/>
                    </UIElement.RenderTransform>
                </local:FZMaterial>
            </Grid>
        </Grid>
        
        <FrameworkElement Style="{StaticResource A_Style_Triggers_For_Context}"/>
    </Grid>
    <local:EventFire.FzTriggers>
        <local:BeginUIStoryboard local:EventFireTrigger.Event="Hide_FadeOut" Storyboard="{StaticResource A_Storyboard_FadeOut}"/>
        <local:BeginUIStoryboard local:EventFireTrigger.Event="Play_WinnerSheen" Storyboard="{StaticResource A_Storyboard_Animate_WinnerSheen}" Storyboard.TargetName="Sheen" />

        <local:BeginUIStoryboard local:EventFireTrigger.Event="Play_CustomTextEnterAnimation" Storyboard="{StaticResource A_Storyboard_Animate_GameText_TwoStrings}" />
        <local:BeginUIStoryboard local:EventFireTrigger.Event="Play_CommonTextEnterAnimation" Storyboard="{StaticResource A_Storyboard_Animate_GameText_Common}"/>
    </local:EventFire.FzTriggers>

    <FrameworkElement.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_FadeIn}" />
            <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_LoopingAnimatedBackground}" />
            <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_HighContrastBg}" />
        </EventTrigger>
    </FrameworkElement.Triggers>
</Page>
