<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_AnimatedContentOpacityMask" ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPatternMask.png"/>

        <MappingConverter x:Key="A_LangStrToMiddleTextMargin" Default="0,30,0,0">
            <MappingConverterEntry Key="CHS" Value="0,35,0,10"/>
            <MappingConverterEntry Key="CHT" Value="0,35,0,10"/>
            <MappingConverterEntry Key="CZ" Value="0,43,0,0"/>
            <MappingConverterEntry Key="ES" Value="0,39,0,0"/>
            <MappingConverterEntry Key="FR" Value="0,36,0,0"/>
            <MappingConverterEntry Key="HU" Value="0,38,0,0"/>
            <MappingConverterEntry Key="JP" Value="0,35,0,12"/>
            <MappingConverterEntry Key="KO" Value="0,35,0,12"/>
            <MappingConverterEntry Key="MX" Value="0,39,0,0"/>
            <MappingConverterEntry Key="TR" Value="0,35,0,23"/>
            <MappingConverterEntry Key="RU" Value="0,40,0,23"/>
        </MappingConverter>

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

        <MappingConverter x:Key="A_MappingConverter_EliminatorAnnouncement_Tape">
            <MappingConverterEntry Key="{NoCase Bold}" Value="{StaticResource A_Style_Run_EliminatorAnnouncement_Tape_BOLD}" />
        </MappingConverter>

        <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="36"/>
            <Setter Property="FontFamily" Value="Horizon_A"/>
        </Style>
        <Style x:Key="A_Style_FZTextBlock_SecondLine" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TextLine_Base}">
            <Setter Property="CapHeight" Value="75"/>
        </Style>

        <Style x:Key="A_Style_FZRun_TextColor_HIGHLIGHT" TargetType="local:FZRun">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}"/>
        </Style>

        <MappingConverter x:Key="A_MappingConverter_TextColor">
            <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_TextColor_HIGHLIGHT}" />
        </MappingConverter>

        <!--Empty FZRun to avoid having to remove Markup-->
        <Style x:Key="A_Style_FZRun_TextColorGold_HIGHLIGHT" TargetType="local:FZRun"/>

        <MappingConverter x:Key="A_MappingConverter_ColorGold" >
            <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_TextColorGold_HIGHLIGHT}" />
        </MappingConverter>

        <Style x:Key="A_Style_FZTextBlock_TapeLine" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TextLine_Base}">
            <Setter Property="CapHeight" Value="36"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="TextAlignment" Value="Center"/>
            <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_EliminatorAnnouncement_Tape}"/>
            <Setter Property="FontFamily"  Value="Horizon_A" />
        </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>

        <local:MappingConverter x:Key="A_Converter_AnnouncementContext_To_BackgroundBrandingPath" Default="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPattern.png">
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.WinGame}" Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPatternGold.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_Converter_AnnouncementContext_To_BackgroundColor" Default="#C8282882">
            <local:MappingConverterEntry Key="{x:Static local:EliminatorAnnouncementContext.WinGame}" Value="#C8CAAB48"/>
        </local:MappingConverter>

        <Style x:Key="A_Style_FZMaterial_BackgroundBranding" TargetType="local:FZMaterial">
            <Setter Property="Height" Value="1024"/>
            <Setter Property="Width" Value="1362"/>
            <Setter Property="TextureWrap" Value="True"/>
        </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:CubicEasing}" />
            </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:CubicEasing}" />
            </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:CubicEasing}" />
            </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="UI_OnlineEvents_Go"/>
                    </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="PART_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 x:Name="PART_LayoutRoot" Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}" Margin="-200,300,0,240">
            <local:FZMaterial x:Name="ColorBackground" 
                              Color="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_AnnouncementContext_To_BackgroundColor}}"
                              Width="1362" Height="600" Stretch="Uniform" ClipToBounds="True" Opacity="1" Margin="84,0,0,16"
                              ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/BGPatternMaskCircular.png"/>
            <local:FZMaterial x:Name="AnimatedBackground" OpacityMask="{StaticResource A_Brush_AnimatedContentOpacityMask}" 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"
                                  ImageSourceNoPreload="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_AnnouncementContext_To_BackgroundBrandingPath}}">
                    <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">

                <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}"
                                           MarkupConverter="{StaticResource A_MappingConverter_TextColor}"
                                           Margin="0,0,0,0"
                                           Effect="{StaticResource A_DropShadowEffect_DefaultHud}"/>
                    </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>

                        <Decorator RenderTransformOrigin="0.5,0.5" RenderTransform="{StaticResource A_Transform_Italic}">
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_SecondLine}" 
                                               Text="{Binding BottomLine}"
                                               MarkupConverter="{StaticResource A_MappingConverter_TextColor}"
                                               Margin="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource  A_LangStrToMiddleTextMargin}}"
                                               Effect="{StaticResource A_DropShadowEffect_DefaultHud}"/>
                        </Decorator>
                    </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,30,0,0">
                            <local:FZMaterial ImageSourceNoPreload="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_AnnouncementContext_To_ImagePath}}"
                                              HorizontalAlignment="Center" 
                                              MinWidth="750" 
                                              MaxWidth="1150" 
                                              Height="65">
                                <Decorator>
                                    <local:FZTextBlock MaxWidth="950" 
                                                       Text="{Binding ExtremeBottomLine}"
                                                       Effect="{StaticResource A_DropShadowEffect_DefaultHud}">
                                        <local:FZTextBlock.Style>
                                            <Style BasedOn="{StaticResource A_Style_FZTextBlock_TapeLine}" TargetType="local:FZTextBlock">
                                                <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_TextColor}"/>
                                                <Style.Triggers>
                                                    <DataTrigger Binding="{Binding AnnouncementContext, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:EliminatorAnnouncementContext.WinGame}">
                                                        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                                                        <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_ColorGold}"/>
                                                    </DataTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </local:FZTextBlock.Style>
                                    </local:FZTextBlock>
                                </Decorator>
                            </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>
