<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:local="clr-namespace:ForzaUI" 
    x:Class="ForzaUI.HUDInstructionControl"
    x:Name="UserControl"
    HorizontalAlignment="Left"
    VerticalAlignment="Top">
    <UserControl.Resources>
        <Style TargetType="{Type FZRun}"
               x:Key="A_Style_Run_Instruction_HIGHLIGHT">
            <Setter Property="Color" Value="{StaticResource A_Color_HUD_HighlightText}"/>
        </Style>

        <Style TargetType="{Type Control}"
               x:Key="A_Style_Run_Instruction_ACTIVATE">
            <Setter Property="Margin" Value="2,0"/>
            <Setter Property="VerticalAlignment" Value="Center"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{Type Control}">
                        <ControllerButtonControl Command="{Binding ActivateCommand}"
                                                 Style="{StaticResource A_Style_ControllerButtonControl_ActivationButton}"
                                                 Height="{Binding ResizedCapHeight, RelativeSource={RelativeSource AncestorType=FZTextBlock}, Converter={LinearTransformConverter Add=6}}"/>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        <MappingConverter x:Key="A_MappingConverter_Instruction">
            <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_Run_Instruction_HIGHLIGHT}" />
            <MappingConverterEntry Key="{NoCase ACTIVATE}" Value="{StaticResource A_Style_Run_Instruction_ACTIVATE}" />
        </MappingConverter>
    </UserControl.Resources>

    <StackPanel x:Name="PART_LayoutRoot" Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Left">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.5"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PART_Hidden">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState Name="PART_Shown"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <ContentControl Template="{StaticResource A_Template_Control_HudInstruction}" Content="{Binding Maintext}" Tag="{Binding Subtext}"/>

    </StackPanel>

</UserControl>