<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:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:local="clr-namespace:ForzaUI"
    mc:Ignorable="d"
    x:Class="ForzaUI.HUDCreationInfoControl"
    x:Name="UserControl"
    Margin="0,23,0,0"
    VerticalAlignment="Top"
    HorizontalAlignment="Left">

    <UserControl.Resources>
        <ExponentialEase x:Key="A_EasingFunction_EaseIn" EasingMode="EaseIn"/>
        <CircleEase x:Key="A_EasingFunction_EaseOut" EasingMode="EaseOut"/>
        <CircleEase x:Key="A_EasingFunction_EaseInOut" EasingMode="EaseInOut"/>

        <Style x:Key="H_Style_CreationInfo_GenericText"
               TargetType="FZTextBlock">
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Effect" Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
        </Style>
        <Style x:Key="H_Style_Text_MainTile_Title"
               TargetType="FZTextBlock"
               BasedOn="{StaticResource H_Style_CreationInfo_GenericText}">
            <Setter Property="CapHeight" Value="15" />
            <Setter Property="FontFamily" Value="Horizon_C" />
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
        </Style>
        <Style x:Key="H_Style_Text_SecondaryTile_Title"
               TargetType="FZTextBlock"
               BasedOn="{StaticResource H_Style_CreationInfo_GenericText}">
            <Setter Property="CapHeight" Value="15" />
            <Setter Property="FontFamily" Value="Horizon_A" />
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
        </Style>
        <Style x:Key="H_Style_Text_ActivateTile_Title"
               TargetType="FZTextBlock"
               BasedOn="{StaticResource H_Style_CreationInfo_GenericText}">
            <Setter Property="CapHeight" Value="15" />
            <Setter Property="FontFamily" Value="Horizon_B" />
            <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="PART_LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <UIVisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="PART_Hidden">
                    <UIStoryboard>
                        <UIStoryboard.TriggerAnimation>
                            <RaiseFzEvent TriggerAnimation.KeyTime="0:0:0.9" EventName="HiddenAnimationComplete"/>
                        </UIStoryboard.TriggerAnimation>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="PART_LayoutRoot">
                            <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Collapsed}"/>
                        </ObjectAnimationUsingKeyFrames>

                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="DisplayPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.9"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" Storyboard.TargetName="DisplayPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0.9"/>
                        </DoubleAnimationUsingKeyFrames>
                    </UIStoryboard>
                </VisualState>
                <VisualState x:Name="PART_Shown">
                    <UIStoryboard>
                        <UIStoryboard.TriggerAnimation>
                            <RaiseFzEvent TriggerAnimation.KeyTime="0:0:4.0" EventName="ShownAnimationComplete"/>
                        </UIStoryboard.TriggerAnimation>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)" Storyboard.TargetName="DisplayPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="-100"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0" EasingFunction="{StaticResource A_EasingFunction_EaseOut}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <UIStoryboard.TriggerAnimation>
                            <RaiseFzEvent EventName="ShowComplete" TriggerAnimation.KeyTime="0:0:3.3"/>
                        </UIStoryboard.TriggerAnimation>
                    </UIStoryboard>
                </VisualState>
            </UIVisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <StackPanel x:Name="DisplayPanel" Orientation="Vertical" RenderTransformOrigin="0.5,0.5" MinWidth="300">
            <StackPanel.RenderTransform>
                <TransformGroup>
                    <ScaleTransform />
                    <TranslateTransform />
                </TransformGroup>
            </StackPanel.RenderTransform>
            <Control Template="{StaticResource A_ControlTemplate_CreationInfo_Content}"
                     local:BindingProxy.A="{Binding ActivateCommand}" />
        </StackPanel>
    </Grid>
</UserControl>