<UserControl DataContext="{Binding (HUDData.Data), RelativeSource={RelativeSource Self}}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:ForzaUI"
             x:Class="ForzaUI.HUDFullscreenTitleControl"
             HorizontalAlignment="Center"
             VerticalAlignment="Center">

    <Grid x:Name="PART_LayoutRoot" RenderTransformOrigin="0.5,0.5" MaxWidth="1440">
        <Grid.RenderTransform>
            <TransformGroup>
                <ScaleTransform x:Name="TextScaler" ScaleX="{StaticResource A_LoadingScreenText_Scale_Minimum}" ScaleY="{Binding ScaleX, RelativeSource={RelativeSource Self}}"/>
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>
        </Grid.RenderTransform>
        <VisualStateManager.VisualStateGroups>
            <UIVisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="PART_Hidden"/>
                <VisualState x:Name="PART_Shown">
                    <UIStoryboard>
                        <UIStoryboard.TriggerAnimation>
                            <RaiseFzEvent TriggerAnimation.KeyTime="0:0:3.5" EventName="PART_ShownComplete"/>
                        </UIStoryboard.TriggerAnimation>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="Title">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:0.5" Value="{StaticResource A_LoadingScreenText_Opacity_Shown}"/>
                            <DiscreteDoubleKeyFrame KeyTime="0:0:3.0" Value="{StaticResource A_LoadingScreenText_Opacity_Shown}"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:3.5" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="TrackingAdjust" Storyboard.TargetName="Title">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="{StaticResource A_LoadingScreenText_TrackingAdjust_Minimum}"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:3.5" Value="{StaticResource A_LoadingScreenText_TrackingAdjust_Maximum}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity" Storyboard.TargetName="SubTitle">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                            <DiscreteDoubleKeyFrame KeyTime="0:0:1.0" Value="0"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:1.5" Value="{StaticResource A_LoadingScreenText_Opacity_Shown}"/>
                            <DiscreteDoubleKeyFrame KeyTime="0:0:3.0" Value="{StaticResource A_LoadingScreenText_Opacity_Shown}"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:3.5" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="TrackingAdjust" Storyboard.TargetName="SubTitle">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="{StaticResource A_LoadingScreenText_TrackingAdjust_Minimum}"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:3.5" Value="{StaticResource A_LoadingScreenText_TrackingAdjust_Maximum}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="ScaleX" Storyboard.TargetName="TextScaler">
                            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="{StaticResource A_LoadingScreenText_Scale_Minimum}"/>
                            <LinearDoubleKeyFrame KeyTime="0:0:3.5" Value="{StaticResource A_LoadingScreenText_Scale_Maximum}"/>
                        </DoubleAnimationUsingKeyFrames>
                    </UIStoryboard>
                </VisualState>
            </UIVisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel Orientation="Vertical">
            <local:FZTextBlock x:Name="Title"
                           Text="{Binding Title}"
                           Style="{StaticResource A_Style_FZTextBlock_TransitionTitle}"/>
            <local:FZTextBlock x:Name="SubTitle"
                           Text="{Binding SubTitle}"
                           Style="{StaticResource A_Style_FZTextBlock_TransitionSubTitle}"
                           Visibility="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StringVisConverter}}"/>
        </StackPanel>
    </Grid>
</UserControl>
