<UserControl
    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.HUDXPAwardControl"
    x:Name="UserControl"
    Margin="465,0,0,37"
    VerticalAlignment="Center"
    HorizontalAlignment="Left" >

    <UserControl.Resources>
        <ResourceDictionary>
            <CircleEase x:Key="A_EasingFunction_Circle_EaseOut" EasingMode="EaseOut"/>
            <CircleEase x:Key="A_EasingFunction_Circle_EaseIn" EasingMode="EaseIn"/>

            <local:NumUnitConverter x:Key="A_NumUnitConverter_XPConverterSpecific" FractionDigits="0" ShowUnit="False" PositiveSign="False"/>

            <Style x:Key="A_Style_FZTextBlock_XPReason" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HudMedium_Tight}">
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="CapHeight" Value="17.5"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_XPAmount" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_XPReason}">
                <Setter Property="CapHeight" Value="32"/>
            </Style>

         </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" VerticalAlignment="Top" HorizontalAlignment="Center">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualState x:Name="Hidden">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0" EasingFunction="{StaticResource A_EasingFunction_Circle_EaseIn}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="MainPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-50" EasingFunction="{StaticResource A_EasingFunction_Circle_EaseIn}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire" Storyboard.TargetProperty="EventName">
                            <DiscreteStringKeyFrame KeyTime="0:0:0.5" Value="HiddenComplete"/>
                        </StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Shown">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="MainPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1" EasingFunction="{StaticResource A_EasingFunction_Circle_EaseIn}"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="MainPanel">
                            <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="25" EasingFunction="{StaticResource A_EasingFunction_Circle_EaseIn}"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="-5" EasingFunction="{StaticResource A_EasingFunction_Circle_EaseOut}"/>
                            <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <StringAnimationUsingKeyFrames Storyboard.TargetName="EventFire" Storyboard.TargetProperty="EventName">
                            <DiscreteStringKeyFrame KeyTime="0:0:0.4" Value="ShownComplete"/>
                        </StringAnimationUsingKeyFrames>
						<StringAnimationUsingKeyFrames Storyboard.TargetName="ShowAudioEvent" Storyboard.TargetProperty="(local:AudioEvent.SoundName)">
							<DiscreteStringKeyFrame KeyTime="0:0:0.0" Value="/Master/UI/DrivingSkills/HZ2_SFX_HUD_DrivingSkills_XPEarned_01" />
						</StringAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <StackPanel x:Name="MainPanel" Orientation="Vertical" HorizontalAlignment="Right">
            <StackPanel.RenderTransform>
                <TranslateTransform />
            </StackPanel.RenderTransform>
            <local:FZTextBlock Text="{Binding XPReasonString}" Style="{StaticResource A_Style_FZTextBlock_XPReason}"/>
            <StackPanel Orientation="Horizontal" Margin="0,8,0,0" HorizontalAlignment="Right">
                <local:FZTextBlock Text="{Binding XPEarned, Converter={StaticResource A_NumUnitConverter_XPConverterSpecific}}" Style="{StaticResource A_Style_FZTextBlock_XPAmount}" Margin="0,0,0,0" VerticalAlignment="Center"/>
                <local:FZMaterial ImageSource="/ForzaUI;component/Textures\Anthem\Icons\Influence_Icon.png" Width="36" Height="36" Margin="6,0,0,0"/>
            </StackPanel>
        </StackPanel>
        <local:EventFire x:Name="EventFire"/>
		<local:AudioEvent x:Name="ShowAudioEvent" />
    </Grid>
</UserControl>
