<Page DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.A_InGameAnnouncement"
      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>

        <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_Announcement">
            <!-- 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="50"
                                      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="ExtremeBottomLine"
                                           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>

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

            <!-- Fade on & off -->
            <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" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                                      Value="0"
                                      EasingFunction="{local:LinearEasing}" />
            </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" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                                      Value="0"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="BgEllipseForContrast"
                                           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" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                                      Value="0"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="ExtremeBottomLine"
                                           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" />
                <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_Announcement_Fade_End}"
                                      Value="0"
                                      EasingFunction="{local:LinearEasing}" />
            </DoubleAnimationUsingKeyFrames>
        </local:UIStoryboard>

        <Style x:Key="A_Style_FZRun_Announcement_TopLine_WHITE"
               TargetType="local:FZRun">
            <Setter Property="Color"
                    Value="#ffffffff" />
        </Style>

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

        <MappingConverter x:Key="A_MarkupConverter_TopLine">
            <MappingConverterEntry Key="{NoCase WHITE}" Value="{StaticResource A_Style_FZRun_Announcement_TopLine_WHITE}" />
            <MappingConverterEntry Key="{NoCase YELLOW}" Value="{StaticResource A_Style_FZRun_Announcement_TopLine_YELLOW}" />
        </MappingConverter>

        <Style x:Key="A_Style_FZRun_Announcement_BottomLine_CREDITS" TargetType="{x:Type Control}"
            BasedOn="{StaticResource H_Style_Control_CreditsIcon}">
            <Setter Property="Margin" Value="0,0,5,0"/>
        </Style>

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

        <MappingConverter x:Key="A_MarkupConverter_BottomLine">
            <MappingConverterEntry Key="{NoCase CREDITS}" Value="{StaticResource A_Style_FZRun_Announcement_BottomLine_CREDITS}" />
            <MappingConverterEntry Key="{NoCase YELLOW}" Value="{StaticResource A_Style_FZRun_Announcement_BottomLine_YELLOW}" />
        </MappingConverter>

        <Style x:Key="A_Style_FZRun_Announcement_ExtremeBottomLine_BOLD" TargetType="local:FZRun">
            <Setter Property="CapHeight" Value="54"/>
            <Setter Property="FontFamily" Value="Horizon_A"/>
        </Style>

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

        <MappingConverter x:Key="A_MarkupConverter_ExtremeBottomLine">
            <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_FZRun_Announcement_ExtremeBottomLine_BOLD}"/>
            <MappingConverterEntry Key="{NoCase YELLOW}" Value="{StaticResource A_Style_FZRun_Announcement_ExtremeBottomLine_YELLOW}"/>
        </MappingConverter>

        <Style x:Key="A_Style_FZTextBlock_TopLine_Common"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="CapHeight" Value="36"/>
            <Setter Property="Margin" Value="0,15"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="MarkupConverter" Value="{StaticResource A_MarkupConverter_TopLine}"/>
            <Setter Property="Text" Value="{Binding TopLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_BottomLine_Common"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="#fff"/>
            <Setter Property="CapHeight" Value="75"/>
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="LineAdjust" Value="-0.4"/>
            <Setter Property="VerticalAlignment" Value="Top"/>
            <Setter Property="MarkupConverter" Value="{StaticResource A_MarkupConverter_BottomLine}"/>
            <Setter Property="Text" Value="{Binding BottomLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_ExtremeBottomLine_Common"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="#fff"/>
            <Setter Property="CapHeight" Value="36"/>
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="LineAdjust" Value="-0.4"/>
            <Setter Property="HorizontalAlignment" Value="Center"/>
            <Setter Property="Margin" Value="0,10,0,10"/>
            <Setter Property="Visibility" Value="{Binding ExtremeBottomLine, Converter={StaticResource A_StringVisConverter}}"/>
            <Setter Property="MarkupConverter" Value="{StaticResource A_MarkupConverter_ExtremeBottomLine}"/>
            <Setter Property="Text" Value="{Binding ExtremeBottomLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_TopLine_Default"
               BasedOn="{StaticResource A_Style_FZTextBlock_TopLine_Common}"
               TargetType="{x:Type local:FZTextBlock}" />

        <Style x:Key="A_Style_FZTextBlock_BottomLine_Default"
               BasedOn="{StaticResource A_Style_FZTextBlock_BottomLine_Common}"
               TargetType="{x:Type local:FZTextBlock}" />

        <Style x:Key="A_Style_FZTextBlock_ExtremeBottomLine_Default"
               BasedOn="{StaticResource A_Style_FZTextBlock_ExtremeBottomLine_Common}"
               TargetType="{x:Type local:FZTextBlock}" />

        <Style x:Key="A_Style_FZTextBlock_TopLine_TreasureHunt"
               BasedOn="{StaticResource A_Style_FZTextBlock_TopLine_Common}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="#ffffffff"/>
            <Setter Property="Text" Value="{Binding TopLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_TopLine_Eliminator"
               BasedOn="{StaticResource A_Style_FZTextBlock_TopLine_Common}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="Text" Value="{Binding TopLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_TopLine_StuntParty"
               BasedOn="{StaticResource A_Style_FZTextBlock_TopLine_Common}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="Text" Value="{Binding TopLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>      
        
        <Style x:Key="A_Style_FZTextBlock_TopLine_HorizonChase"
               BasedOn="{StaticResource A_Style_FZTextBlock_TopLine_Common}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            <Setter Property="Text" Value="{Binding TopLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>

        <Style x:Key="A_Style_FZTextBlock_ExtremeBottomLine_StuntParty"
               BasedOn="{StaticResource A_Style_FZTextBlock_ExtremeBottomLine_Common}"
               TargetType="{x:Type local:FZTextBlock}">
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}"/>
            <Setter Property="Text" Value="{Binding ExtremeBottomLine, Converter={StaticResource A_StringToUpper}}" />
        </Style>


        <local:MappingConverter x:Key="A_Converter_TypeToTopLineStyle"
                                Default="{StaticResource A_Style_FZTextBlock_TopLine_Default}" CheckEnumKey="InGameAnnouncementType">
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.TreasureHunt}" Value="{StaticResource A_Style_FZTextBlock_TopLine_TreasureHunt}" />
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.Eliminator}" Value="{StaticResource A_Style_FZTextBlock_TopLine_Eliminator}" />
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.StuntParty}" Value="{StaticResource A_Style_FZTextBlock_TopLine_StuntParty}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.HorizonChase}" Value="{StaticResource A_Style_FZTextBlock_TopLine_HorizonChase}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.HideSeek}" Value="{StaticResource A_Style_FZTextBlock_TopLine_Default}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.Labyrinth}" Value="{StaticResource A_Style_FZTextBlock_TopLine_Default}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_Converter_TypeToExtremeBottomLineStyle"
                                Default="{StaticResource A_Style_FZTextBlock_ExtremeBottomLine_Default}">
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.StuntParty}" Value="{StaticResource A_Style_FZTextBlock_ExtremeBottomLine_StuntParty}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_Converter_TypeToTopLineBannerColor"
                                Default="Transparent">
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.StuntParty}" Value="{StaticResource H_Color_Primary_White}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.HorizonChase}" Value="{StaticResource H_Color_Primary_LightBlue}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_Converter_TypeToExtremeBottomLineBannerColor"
                                Default="Transparent">
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.Eliminator}" Value="{StaticResource H_Color_Primary_White}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.TreasureHunt}" Value="{StaticResource H_Color_Primary_White}"/>
            <local:MappingConverterEntry Key="{x:Static local:InGameAnnouncementType.HorizonChase}" Value="{StaticResource H_Color_Primary_White}"/>
        </local:MappingConverter>

        <Style x:Key="A_Style_Audio_Context_Triggers" TargetType="FrameworkElement">
            <Style.Triggers>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Standard}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="UI_OnlineEvents_Go"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Victory}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_ELM_Versus_H2H_Win"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Chase_Shinkansen}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_Announcement_Chase_Shinkansen"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Chase_RuralTrain}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_Announcement_Chase_RuralTrain"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Chase_Chopper}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_Announcement_Chase_Chopper"/>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding AnnouncementAudio, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:InGameAnnouncementSound.Chase_End}">
                    <DataTrigger.EnterActions>
                        <local:StartAudioTrigger local:TriggerAnimation.KeyTime="{StaticResource A_KeyTime_Announcement_Begin}"
                        EventName="AudioUITrigger_Announcement_Chase_End"/>
                    </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 Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Decorator Margin="146,0,146,0">
                <Grid RenderTransformOrigin="0.5,0.5"
                  HorizontalAlignment="Center"
                  VerticalAlignment="Center">
                    <StackPanel Margin="0,60,0,0">
                        <!-- ZIndex on this decorator ensures that it renders in front of the BgEllipse, which is below for layout reasons -->
                        <Decorator x:Name="TopLine"
                               ZPanel.ZIndex="1"
                               Effect="{StaticResource A_MotionBlurEffect}"
                               local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                               Opacity="0">
                            <UIElement.RenderTransform>
                                <TranslateTransform />
                            </UIElement.RenderTransform>
                            <Decorator RenderTransformOrigin="0.5,0.5">
                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/Pink_Banner.png"
                                                  Color="{Binding AnnouncementType, Converter={StaticResource A_Converter_TypeToTopLineBannerColor}}">
                                    <local:FZTextBlock 
                                        Style="{Binding AnnouncementType, Converter={StaticResource A_Converter_TypeToTopLineStyle}, FallbackValue={StaticResource A_Style_FZTextBlock_TopLine_Default}}" 
                                        Effect="{StaticResource A_DropShadowEffect_DefaultHud}"/>
                                </local:FZMaterial>
                            </Decorator>
                        </Decorator>
                        <Decorator Height="30" />

                        <Grid>
                            <!-- this grid allows the BgEllipse viewbox (which spans all cols/rows) to size itself based on the actual notification content in the center of the 3x3 grid, without actually affecting the size of it as it would if they shared the same grid cell -->
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                                <RowDefinition Height="*" />
                            </Grid.RowDefinitions>
                            <Grid.ColumnDefinitions>
                                <ColumnDefinition Width="*" />
                                <ColumnDefinition Width="Auto" />
                                <ColumnDefinition Width="*" />
                            </Grid.ColumnDefinitions>
                            <Viewbox x:Name="BgEllipseForContrast" Opacity="0" Grid.Row="0" Grid.Column="0" Grid.RowSpan="3" Grid.ColumnSpan="3" Stretch="Fill" StretchDirection="Both" 
                                    Margin="{StaticResource A_Thickness_BgEllipseMargins}"
                                    MaxWidth="{Binding ActualWidth, ElementName=BottomLine, Mode=OneWay, Converter={MathOperationConverter Operation=Add}, ConverterParameter={StaticResource A_Double_BgEllipsePaddingW}}"
                                    MaxHeight="{Binding ActualHeight, ElementName=BottomLine, Mode=OneWay, Converter={MathOperationConverter Operation=Add}, ConverterParameter={StaticResource A_Double_BgEllipsePaddingH}}">
                                <!-- this material should be a circle, so it can be distorted by the viewbox around it into an appropriately sized/shaped ellipse -->
                                <FZMaterial Style="{StaticResource H_Style_FZMaterial_BgEllipse_CircleShadow}" />
                            </Viewbox>
                            <Decorator x:Name="BottomLine" Grid.Row="1" Grid.Column="1"
                                   Effect="{StaticResource A_MotionBlurEffect}"
                                   local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                                   RenderTransformOrigin="0.5,0.5"
                                   Opacity="0">
                                <UIElement.RenderTransform>
                                    <TranslateTransform />
                                </UIElement.RenderTransform>
                                <Decorator HorizontalAlignment="Center">
                                    <local:FZTextBlock 
                                        Style="{StaticResource A_Style_FZTextBlock_BottomLine_Default}" 
                                        Effect="{StaticResource A_DropShadowEffect_DefaultHud}"/>
                                </Decorator>
                            </Decorator>
                        </Grid>

                        <Decorator Height="30" />

                        <Decorator x:Name="ExtremeBottomLine"
                               Effect="{StaticResource A_MotionBlurEffect}"
                               local:MotionBlurEffect.MotionBlurPositionXControl="{Binding RenderTransform.X, RelativeSource={RelativeSource Self}}"
                               RenderTransformOrigin="0.5,0.5"
                               Opacity="0">
                            <UIElement.RenderTransform>
                                <TranslateTransform />
                            </UIElement.RenderTransform>
                            <Decorator>
                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Eliminator/EliminatorAnnouncement/Pink_Banner.png"
                                                  Color="{Binding AnnouncementType, Converter={StaticResource A_Converter_TypeToExtremeBottomLineBannerColor}}">
                                    <local:FZTextBlock 
                                        Style="{Binding AnnouncementType, Converter={StaticResource A_Converter_TypeToExtremeBottomLineStyle}, FallbackValue={StaticResource A_Style_FZTextBlock_ExtremeBottomLine_Default}}" 
                                        Effect="{StaticResource A_DropShadowEffect_DefaultHud}"/>
                                </local:FZMaterial>
                            </Decorator>
                        </Decorator>
                    </StackPanel>
                </Grid>
            </Decorator>
        </Grid>
       <FrameworkElement Style="{StaticResource A_Style_Audio_Context_Triggers}"/>
    </Grid>
    <FrameworkElement.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_Announcement}" />
            <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_HighContrastBg}" />
        </EventTrigger>
    </FrameworkElement.Triggers>
</Page>
