<Page x:Class="ForzaUI.A_NotificationLayer"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      mc:Ignorable="d"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">
    <Page.Resources>
        <Thickness x:Key="A_Thickness_DialogueTextInternalMargin">4,-18,4,20</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextInternalMargin_DEV">4,-18,4,20</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextInternalMargin_EN">4,-18,4,20</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextInternalMargin_GB">4,-18,4,20</Thickness>

        <Thickness x:Key="A_Thickness_DialogueTextContainerMargin">-4,6,-4,0</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextContainerMargin_DEV">-4,6,-4,0</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextContainerMargin_EN">-4,6,-4,0</Thickness>
        <Thickness x:Key="A_Thickness_DialogueTextContainerMargin_GB">-4,6,-4,0</Thickness>

        <Style x:Key="A_Style_Text_Subtitles"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_Body}">
            <Setter Property="Color"
                    Value="#F5F5F5" />
            <Setter Property="FontSize"
                    Value="28" />
            <Setter Property="Effect"
                    Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
            <Setter Property="TextAlignment"
                    Value="Center" />
        </Style>

        <System:Double x:Key="A_Double_DialogLineHeight">30</System:Double>
        <System:Double x:Key="A_Double_DialogLineHeight_DEV">30</System:Double>
        <System:Double x:Key="A_Double_DialogLineHeight_EN">30</System:Double>
        <System:Double x:Key="A_Double_DialogLineHeight_GB">30</System:Double>

        <System:Double x:Key="A_Double_DialogueTextContainerHeight">68</System:Double>
        <System:Double x:Key="A_Double_DialogueTextContainerHeight_DEV">68</System:Double>
        <System:Double x:Key="A_Double_DialogueTextContainerHeight_EN">68</System:Double>
        <System:Double x:Key="A_Double_DialogueTextContainerHeight_GB">68</System:Double>

        <Color x:Key="A_Color_DialogueDropShadow">#B7262626</Color>
        <DropShadowEffect x:Key="A_DropShadowEffect_DialogueHud" Color="{StaticResource A_Color_DialogueDropShadow}" BlurRadius="0" ShadowDepth="1"/>

        <Style x:Key="A_Style_Text_Dialogue_Base"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
            <Setter Property="Color"
                    Value="#FFFFFF" />
            <Setter Property="FontSize"
                    Value="25" />
            <Setter Property="Effect"
                    Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
            <Setter Property="TextAlignment"
                    Value="Left" />
            <Setter Property="TextWrapping"
                    Value="Wrap" />
            <Setter Property="Effect"
                    Value="{StaticResource A_DropShadowEffect_DialogueHud}" />
        </Style>

        <Style x:Key="A_Style_Text_Dialogue"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_Text_Dialogue_Base}">
            <Setter Property="LineStackingStrategy"
                    Value="BlockLineHeight" />
            <Setter Property="LineHeight"
                    Value="{local:LocalizedResource A_Double_DialogLineHeight}" />
            <Setter Property="MinHeight"
                    Value="{local:LocalizedResource A_Double_DialogLineHeight}" />
        </Style>

        <ControlTemplate x:Key="A_ControlTemplate_VOIcon"
                         TargetType="{x:Type Control}">
            <ControlTemplate.Resources>
                <BitmapImage x:Key="A_BitmapImage_SoundBarLeft" UriSource="/ForzaUI;component/Textures/Anthem/Icons/VO/SoundBar_Left.png" />
                <BitmapImage x:Key="A_BitmapImage_SoundBarRight" UriSource="/ForzaUI;component/Textures/Anthem/Icons/VO/SoundBar_Right.png" />
                <BitmapImage x:Key="A_BitmapImage_SpeakerBackground" UriSource="/ForzaUI;component/Textures/Anthem/Icons/VO/Speaker_Background.png" />
                <BitmapImage x:Key="A_BitmapImage_SpeakerIcon" UriSource="/ForzaUI;component/Textures/Anthem/Icons/VO/Speaker_Icon.png" />

                <local:MappingConverter x:Key="A_MappingConverter_FZMaterial_Icon_FromCharacterId" Default="{x:Null}">
                    <local:MappingConverterEntry Key="10" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_Pulse.png" />
                    <local:MappingConverterEntry Key="11" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_BassArena.png" />
                    <local:MappingConverterEntry Key="12" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_BlockParty.png" />
                    <local:MappingConverterEntry Key="13" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_XS.png" />
                    <local:MappingConverterEntry Key="14" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_Hospital.png" />
                    <local:MappingConverterEntry Key="15" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_Timeless.png" />
                    <local:MappingConverterEntry Key="34" Value="/ForzaUI;component/Textures/Anthem/Icons/VO/VO_ForzathonLive.png" />
                </local:MappingConverter>

                <local:MappingConverter x:Key="A_MappingConverter_FZMaterial_Color_FromCharacterId" Default="#222222">
                    <local:MappingConverterEntry Key="1" Value="{StaticResource A_Color_VO_Kiera}" />
                    <local:MappingConverterEntry Key="2" Value="{StaticResource A_Color_VO_Anna}" />
                    <local:MappingConverterEntry Key="3" Value="{StaticResource A_Color_VO_Alex}" />
                    <local:MappingConverterEntry Key="4" Value="{StaticResource A_Color_VO_Jaimin}" />
                    <local:MappingConverterEntry Key="5" Value="{StaticResource A_Color_VO_Joel}" />
                    <local:MappingConverterEntry Key="6" Value="{StaticResource A_Color_VO_Mike}" />
                    <local:MappingConverterEntry Key="7" Value="{StaticResource A_Color_VO_Rebecca}" />
                    <local:MappingConverterEntry Key="8" Value="{StaticResource A_Color_VO_Billy}" />
                    <local:MappingConverterEntry Key="9" Value="{StaticResource A_Color_VO_Hans}" />
                    <local:MappingConverterEntry Key="10" Value="{StaticResource A_Color_VO_PulseDJ}" />
                    <local:MappingConverterEntry Key="11" Value="{StaticResource A_Color_VO_BassArenaDJ}" />
                    <local:MappingConverterEntry Key="12" Value="{StaticResource A_Color_VO_BlockPartyDJ}" />
                    <local:MappingConverterEntry Key="13" Value="{StaticResource A_Color_VO_XSDJ}" />
                    <local:MappingConverterEntry Key="14" Value="{StaticResource A_Color_VO_HospitalDJ}" />
                    <local:MappingConverterEntry Key="15" Value="{StaticResource A_Color_VO_TimelessDJ}" />
                    <local:MappingConverterEntry Key="16" Value="{StaticResource A_Color_VO_Isha}" />
                    <local:MappingConverterEntry Key="17" Value="{StaticResource A_Color_VO_LaRacer}" />
                    <local:MappingConverterEntry Key="18" Value="{StaticResource A_Color_VO_Robert}" />
                    <local:MappingConverterEntry Key="19" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="20" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="21" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="22" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="23" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="24" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="25" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="26" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="27" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="28" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="29" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="30" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="31" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="32" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="33" Value="{StaticResource A_Color_VO_TaxiPassenger}" />
                    <local:MappingConverterEntry Key="34" Value="{StaticResource A_Color_VO_Announcer}" />
                    <local:MappingConverterEntry Key="35" Value="{StaticResource A_Color_VO_BikerRed}" />
                    <local:MappingConverterEntry Key="36" Value="{StaticResource A_Color_VO_BikerBlue}" />
                    <local:MappingConverterEntry Key="37" Value="{StaticResource A_Color_VO_BikerPurple}" />
                    <local:MappingConverterEntry Key="38" Value="{StaticResource A_Color_VO_BikerYellow}" />
                    <local:MappingConverterEntry Key="39" Value="{StaticResource A_Color_VO_Cortana}" />
                    <local:MappingConverterEntry Key="40" Value="{StaticResource A_Color_VO_Marine}" />
                    <local:MappingConverterEntry Key="41" Value="{StaticResource A_Color_VO_PelicanPilot}" />
                    <local:MappingConverterEntry Key="42" Value="{StaticResource A_Color_VO_ScottT}" />
                    <local:MappingConverterEntry Key="43" Value="{StaticResource A_Color_VO_Story11_Narrator}" />
                </local:MappingConverter>

                <System:Double x:Key="A_Double_Soundbar_MinOpacity">0.3</System:Double>
                <System:Double x:Key="A_Double_Soundbar_MaxOpacity">1</System:Double>

                <Storyboard x:Key="A_Storyboard_Pulse" RepeatBehavior="Forever">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SoundBarRight">
                        <EasingDoubleKeyFrame KeyTime="0:0:0" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.06" Value="{StaticResource A_Double_Soundbar_MaxOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.32" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SoundBarLeft">
                        <EasingDoubleKeyFrame KeyTime="0:0:0" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.26" Value="{StaticResource A_Double_Soundbar_MaxOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.52" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                        <EasingDoubleKeyFrame KeyTime="0:0:1.6" Value="{StaticResource A_Double_Soundbar_MinOpacity}"/>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
            </ControlTemplate.Resources>
            <local:FZMaterial x:Name="PillBacking" Height="68" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileLeft}" Color="{Binding CharacterId, RelativeSource={RelativeSource AncestorType=local:DialogueControl}, Converter={StaticResource A_MappingConverter_FZMaterial_Color_FromCharacterId}}">
                <Grid Margin="10,0,10,0">
                    <Grid x:Name="SpeakerTextures"  Margin="0,-16,0,0" Visibility="Hidden">
                        <local:FZMaterial x:Name="SpeakerBacking" Width="56" Height="50" ImageSource="{StaticResource A_BitmapImage_SpeakerBackground}" Color="{Binding CharacterId, RelativeSource={RelativeSource AncestorType=local:DialogueControl}, Converter={StaticResource A_MappingConverter_FZMaterial_Color_FromCharacterId}}"  VerticalAlignment="Top"/>
                        <local:FZMaterial x:Name="SoundBarLeft" Width="56" Height="50" ImageSource="{StaticResource A_BitmapImage_SoundBarLeft}" VerticalAlignment="Top"/>
                        <local:FZMaterial x:Name="SoundBarRight" Width="56" Height="50" ImageSource="{StaticResource A_BitmapImage_SoundBarRight}" VerticalAlignment="Top"/>
                        <local:FZMaterial x:Name="SpeakerIcon" Width="56" Height="50" ImageSource="{StaticResource A_BitmapImage_SpeakerIcon}" VerticalAlignment="Top"/>
                    </Grid>
                    <Decorator x:Name="CharacterName" Visibility="Collapsed" RenderTransformOrigin="0.5,0.5" RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}" VerticalAlignment="Bottom" >
                        <local:FZTextBlock Text="{Binding CharacterDisplayName, RelativeSource={RelativeSource AncestorType=local:DialogueControl}}" Color="#FFFFFF"  CapHeight="20" HorizontalAlignment="Center"  Margin="0,2,0,8"/>
                    </Decorator>
                    <local:FZMaterial x:Name="CharacterIcon" Width="78" Height="68" ImageSource="{Binding CharacterId, RelativeSource={RelativeSource AncestorType=local:DialogueControl}, Converter={StaticResource A_MappingConverter_FZMaterial_Icon_FromCharacterId}}"/>
                </Grid>
            </local:FZMaterial>
            <ControlTemplate.Triggers>
                <DataTrigger Binding="{Binding ImageSource, ElementName=CharacterIcon}" Value="{x:Null}">
                    <Setter TargetName="CharacterIcon" Property="Visibility" Value="Hidden"/>
                    <Setter TargetName="SpeakerTextures" Property="Visibility" Value="Visible"/>
                    <Setter TargetName="CharacterName" Property="Visibility" Value="Visible"/>
                </DataTrigger>
                <DataTrigger Binding="{Binding Show, RelativeSource={RelativeSource AncestorType=local:DialogueControl}}" Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Pulse}" />
                    </DataTrigger.EnterActions>
                </DataTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <ControlTemplate x:Key="A_ControlTemplate_DialogueControl"
                         TargetType="{x:Type local:DialogueControl}">
            <ControlTemplate.Resources>
                <local:MappingConverter x:Key="A_MappingConverter_FZMaterialGlassCapture_SubtitlePositionToVisibility" Default="Visible">
                    <local:MappingConverterEntry Key="{x:Static local:DialogueSubtitlePosition.HudAnalogSpeedometer}" Value="Collapsed" />
                    <local:MappingConverterEntry Key="{x:Static local:DialogueSubtitlePosition.HudDigitalSpeedometer}" Value="Collapsed" />
                    <local:MappingConverterEntry Key="{x:Static local:DialogueSubtitlePosition.HudNoSpeedometer}" Value="Collapsed" />
                </local:MappingConverter>

                <Storyboard x:Key="A_Storyboard_Show">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="control_root">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.0"
                                              Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="1" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"
                                                   Storyboard.TargetName="text_container">
                        <EasingDoubleKeyFrame KeyTime="0:0:0"
                                              Value="80" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0">
                            <EasingDoubleKeyFrame.EasingFunction>
                                <QuarticEase EasingMode="EaseOut" />
                            </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                <Storyboard x:Key="A_Storyboard_Hide">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="control_root">
                        <EasingDoubleKeyFrame KeyTime="0:0:1.0"
                                              Value="1" />
                        <EasingDoubleKeyFrame KeyTime="0:0:1.3"
                                              Value="0" />
                    </DoubleAnimationUsingKeyFrames>
                </Storyboard>
                <local:UIStoryboard x:Key="A_Storyboard_BlendValueInputChanged">
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}"
                                                   FillBehavior="Stop"
                                                   Storyboard.TargetProperty="(local:BlendValue.Blend)">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                                Value="0" />
                        <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                              Value="1">
                            <EasingDoubleKeyFrame.EasingFunction>
                                <QuarticEase EasingMode="EaseOut" />
                            </EasingDoubleKeyFrame.EasingFunction>
                        </EasingDoubleKeyFrame>
                    </DoubleAnimationUsingKeyFrames>
                </local:UIStoryboard>
            </ControlTemplate.Resources>
            <DockPanel x:Name="control_root" Opacity="0" MaxWidth="550">
                <local:FZMaterialGlassCapture x:Name="GlassCapture" Visibility="{Binding DialoguePosition, Converter={StaticResource A_MappingConverter_FZMaterialGlassCapture_SubtitlePositionToVisibility}}"/> 
                <Control Template="{StaticResource A_ControlTemplate_VOIcon}" DockPanel.Dock="Left" VerticalAlignment="Center"/>
                <local:FZMaterial x:Name="TextBacking" Style="{StaticResource A_Style_FZMaterial_GlassPanel_Right}">
                    <Grid Margin="12,0">
                        <Decorator x:Name="text_container" ClipToBounds="True" VerticalAlignment="Bottom" Height="{local:LocalizedResource A_Double_DialogueTextContainerHeight}" Margin="{local:LocalizedResource A_Thickness_DialogueTextContainerMargin}">
                            <Decorator Margin="{local:LocalizedResource A_Thickness_DialogueTextInternalMargin}">
                                <Decorator>
                                    <local:FZTextBlock x:Name="text_element"
                                                   Style="{StaticResource A_Style_Text_Dialogue}"
                                                   Text="{Binding Text, RelativeSource={RelativeSource AncestorType=local:DialogueControl}}" 
                                                   VerticalAlignment="Top" 
                                                   Margin="0,28,0,0"
                                                   Stretch="None"
                                                   local:BlendValue.InputChangedStoryboard="{StaticResource A_Storyboard_BlendValueInputChanged}"
                                                   local:BlendValue.Input="{Binding TextOffset, RelativeSource={RelativeSource AncestorType=local:DialogueControl}}" 
                                                   local:DialogueControl.TextHeight="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"
                                                   Visibility="{Binding SubtitlesEnabled, RelativeSource={RelativeSource AncestorType=local:DialogueControl}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                                    <Decorator.RenderTransform>
                                        <TranslateTransform Y="{Binding Path=(local:BlendValue.Output), ElementName=text_element}" />
                                    </Decorator.RenderTransform>
                                </Decorator>
                            </Decorator>
                            <Decorator.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform />
                                    <SkewTransform />
                                    <RotateTransform />
                                    <TranslateTransform />
                                </TransformGroup>
                            </Decorator.RenderTransform>
                        </Decorator>
                        <local:FZTextBlock Style="{StaticResource A_Style_Text_Dialogue_Base}"
                        Text="{local:Loc Main.IDS_Please_Wait_Title}"
                        VerticalAlignment="Center"
                        Stretch="None"
                        Visibility="{Binding SubtitlesEnabled, RelativeSource={RelativeSource AncestorType=local:DialogueControl}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"/>
                    </Grid>
                </local:FZMaterial>
            </DockPanel>
            <ControlTemplate.Triggers>
                <DataTrigger Binding="{Binding Show, RelativeSource={RelativeSource Self}}"
                             Value="True">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Show}" />
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Hide}" />
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <!--Used inside A_ControlTemplate_AuctionNotification as inline markup resource-->
        <Style TargetType="Control" x:Key="A_Style_AuctionAction_Button">
            <Setter Property="Margin"
                    Value="0,0,0,0" />
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="Control">
                        <Viewbox Height="30"
                                 Stretch="Uniform"
                                 StretchDirection="Both">
                            <local:ControllerButtonControl Button="RTrigger"
                                                           Style="{StaticResource A_Style_ControllerButtonControl_Default_ShowAlways}"
                                                           Margin="0" />
                        </Viewbox>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <ControlTemplate x:Key="A_ControlTemplate_AuctionNotification"
                         TargetType="{x:Type Control}">
            <ControlTemplate.Resources>
                <System:Double x:Key="A_Double_Height">66</System:Double>

                <Style x:Key="A_Style_FZTextBlock_Base"
                       TargetType="{x:Type local:FZTextBlock}">
                    <Setter Property="FontFamily"
                            Value="Horizon_A" />
                    <Setter Property="FontSize"
                            Value="21" />
                    <Setter Property="Color"
                            Value="{StaticResource A_Color_Tile_Text}" />
                </Style>

            </ControlTemplate.Resources>
            <StackPanel x:Name="grid"
                        Orientation="Horizontal"
                        Opacity="1">
                <local:FZMaterial HorizontalAlignment="Left"
                                  Width="66" Height="66"
                                  Panel.ZIndex="1"
                                  Style="{StaticResource A_Style_FZMaterial_FlatPanel_LeftHeaderPanel}">
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Titles/AuctionHouse.png" />
                </local:FZMaterial>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}">
                    <Grid Margin="12">
                        <local:FZTextBlock Text="{Binding Title}"
                                           Style="{StaticResource A_Style_FZTextBlock_Base}"
                                           Color="{StaticResource A_Color_AuctionNotificationText}"
                                           VerticalAlignment="Top" />
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_Base}"
                                           VerticalAlignment="Bottom"
                                           local:TextBlockInlineMarkup.Markup="{Binding Text}"
                                           local:TextBlockInlineMarkup.ResourceBaseName="A_Style_AuctionAction_" />
                    </Grid>
                </local:FZMaterial>
            </StackPanel>
        </ControlTemplate>

        <CubicEase x:Key="A_Easingfunction_AuctionNotification_Slide" />

        <Storyboard x:Key="A_Storyboard_ShowHUDStatusAuctionNotification">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                      Value="1"
                                      EasingFunction="{StaticResource A_Easingfunction_AuctionNotification_Slide}" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:4.3"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:4.6"
                                      Value="0"
                                      EasingFunction="{StaticResource A_Easingfunction_AuctionNotification_Slide}" />
            </DoubleAnimationUsingKeyFrames>
            <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="DataContext.Complete"
                                            Storyboard.TargetName="{x:Null}">
                <DiscreteBooleanKeyFrame KeyTime="0:0:0"
                                         Value="False" />
                <DiscreteBooleanKeyFrame KeyTime="0:0:4.6"
                                         Value="True" />
            </BooleanAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="A_Storyboard_HideHUDStatusAuctionNotification">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="{x:Null}">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                        Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <local:LinearTransformConverter x:Key="A_Converter_OneMinusX"
                                        Scale="-1.0"
                                        Add="1" />

        <Style x:Key="A_Style_FZTextBlock_WatermarkGamertag"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
            <Setter Property="Text"
                    Value="{Binding WatermarkGamertag}" />
            <Setter Property="Color"
                    Value="#FFFFFF" />
            <Setter Property="CapHeight"
                    Value="120" />
            <Setter Property="Margin"
                    Value="-100,0,-100,0" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Setter Property="HorizontalAlignment"
                    Value="Center" />
            <Setter Property="TextAlignment"
                    Value="Center" />
        </Style>

        <Style x:Key="A_Style_FrameworkElement_GamertagContainer"
               TargetType="FrameworkElement">
            <Setter Property="LayoutTransform">
                <Setter.Value>
                    <TransformGroup>
                        <ScaleTransform ScaleX="{Binding Path=AutoScaleValue, Source={StaticResource PART_UIResolutionScaler}}"
                                        ScaleY="{Binding Path=AutoScaleValue, Source={StaticResource PART_UIResolutionScaler}}" />
                        <RotateTransform Angle="-30" />
                    </TransformGroup>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="A_Style_FZTextBlock_WatermarkBuildInfo"
               TargetType="{x:Type local:FZTextBlock}"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonC}">
            <Setter Property="Text"
                    Value="{Binding WatermarkBuildInfo}" />
            <Setter Property="Color"
                    Value="#FFFFFF" />
            <Setter Property="CapHeight"
                    Value="40" />
            <Setter Property="VerticalAlignment"
                    Value="Bottom" />
            <Setter Property="HorizontalAlignment"
                    Value="Right" />
            <Setter Property="Margin"
                    Value="50,20,50,50" />
            <Setter Property="LayoutTransform">
                <Setter.Value>
                    <ScaleTransform ScaleX="{Binding Path=AutoScaleValue, Source={StaticResource PART_UIResolutionScaler}}"
                                    ScaleY="{Binding Path=AutoScaleValue, Source={StaticResource PART_UIResolutionScaler}}" />
                </Setter.Value>
            </Setter>
        </Style>
    </Page.Resources>
    <Grid Visibility="{Binding IsEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}"
              HorizontalAlignment="Stretch"
              VerticalAlignment="Stretch"
              Height="Auto"
              Width="Auto">

            <local:NotificationPopupControl x:Name="HUDStatusNotificationPopup"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Top"
                                            Margin="0,43,0,0" />
            <local:HUD321Control x:Name="HUDStatus321"
                                 Margin="0,300,0,0"
                                 VerticalAlignment="Top"
                                 HorizontalAlignment="Center" />
            <StackPanel Margin="0,0,0,128"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Bottom">
                <local:HUDRaceFinishCountdownControl x:Name="HUDStatusRaceCountdown" />
                <Decorator Height="64"
                           Visibility="{Binding IsE3, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
            </StackPanel>
            <Viewbox Height="60" Stretch="Uniform"
                    VerticalAlignment="Bottom"
                    HorizontalAlignment="Right" 
                    Margin="0,0,50,70">
            <local:DialogueControl 
                    Template="{StaticResource A_ControlTemplate_DialogueControl}"
                    TextLineHeight="{local:LocalizedResource A_Double_DialogLineHeight}"
                    Height="68">
                <!-- The dialogue control has animations to position it for each screen. -->
                <local:DialogueControl.Resources>
                    <Storyboard x:Key="Move_Normal">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="Move_LoadingScreens">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="-155" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="Move_HudAnalogSpeedometer">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="-345" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="Move_HudDigitalSpeedometer">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="-172" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="Move_HudNoSpeedometer">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="-46" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                    <Storyboard x:Key="Move_NetworkCountdown">
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="-330" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                                                  Value="0" >
                                <EasingDoubleKeyFrame.EasingFunction>
                                    <QuarticEase EasingMode="EaseOut" />
                                </EasingDoubleKeyFrame.EasingFunction>
                            </EasingDoubleKeyFrame>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </local:DialogueControl.Resources>
                <local:DialogueControl.Style>
                    <Style TargetType="{x:Type local:DialogueControl}">
                        <Style.Triggers>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.Normal}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_Normal}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.LoadingScreens}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_LoadingScreens}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.HudAnalogSpeedometer}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_HudAnalogSpeedometer}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.HudDigitalSpeedometer}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_HudDigitalSpeedometer}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.HudNoSpeedometer}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_HudNoSpeedometer}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                            <DataTrigger Binding="{Binding DialoguePosition}" Value="{x:Static local:DialogueSubtitlePosition.NetworkCountdown}">
                                <DataTrigger.EnterActions>
                                    <BeginStoryboard Storyboard="{StaticResource Move_NetworkCountdown}" />
                                </DataTrigger.EnterActions>
                            </DataTrigger>
                        </Style.Triggers>
                    </Style>
                </local:DialogueControl.Style>
                <local:DialogueControl.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </local:DialogueControl.RenderTransform>
                </local:DialogueControl>

            </Viewbox>

            <local:FZTextBlock x:Name="Subtitles"
                               Style="{StaticResource A_Style_Text_Subtitles}"
                               Width="1000"
                               HorizontalAlignment="Center"
                               Margin="0,0,0,50"
                               TextWrapping="Wrap"
                               VerticalAlignment="Bottom"
                               Text="{Binding Subtitles.Subtitle}" />

            <ContentControl Style="{StaticResource A_Style_ContentControl_AnimatedTagSlideFromRight}"
                            x:Name="HUDStatusAuctionNotification"
                            Opacity="0"
                            Tag="{Binding Opacity, RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_OneMinusX}}">
                <local:EventFire.FzTriggers>
                    <local:EventFireTrigger Event="ShowHUDStatusAuctionNotification"
                                            Storyboard="{StaticResource A_Storyboard_ShowHUDStatusAuctionNotification}" />
                    <local:EventFireTrigger Event="HideHUDStatusAuctionNotification"
                                            Storyboard="{StaticResource A_Storyboard_HideHUDStatusAuctionNotification}" />
                </local:EventFire.FzTriggers>
                <Control HorizontalAlignment="Right"
                         VerticalAlignment="Bottom"
                         Margin="0,0,78,60"
                         Effect="{StaticResource A_MotionBlurEffect}"
                         Template="{StaticResource A_ControlTemplate_AuctionNotification}" />
            </ContentControl>

            <local:FZTextBlock 
                Visibility="{Binding VideoStats.Visible, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}"
                Text="{Binding VideoStats.FPS}" 
                Style="{StaticResource A_Style_Text_Dialogue}"
                Margin="5"
                VerticalAlignment="Top" 
                HorizontalAlignment="Right" />
        </Grid>
          <DockPanel x:Name="FlightingWatermark" Opacity="0.2" Visibility="{Binding ShowWatermark, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
              <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkBuildInfo}" DockPanel.Dock="Bottom" />
        
              <UniformGrid Rows="3" Columns="5">
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
                  <Decorator Style="{StaticResource A_Style_FrameworkElement_GamertagContainer}">
                      <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_WatermarkGamertag}" />
                  </Decorator>
              </UniformGrid>
          </DockPanel>
    </Grid>
</Page>
