<UserControl
             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.HUDSpeedCameraControl" 
             mc:Ignorable="d">

    <UserControl.Resources>

        <Color x:Key="A_Color_Text">#F5F5F5</Color>
        
        <Style x:Key="A_Style_Text_Title" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_AnthemA}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Color" Value="{StaticResource A_Color_Text}" />
            <Setter Property="FontSize" Value="28"/>
        </Style>

        <Style x:Key="A_Style_Text_Body" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_Text_Title}">
            <Setter Property="FontSize" Value="65"/>
        </Style>
    </UserControl.Resources>
    <StackPanel x:Name="OuterPanel" RenderTransformOrigin="0.5,0.5">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.3"/>
                </VisualStateGroup.Transitions>

                <VisualState x:Name="Hidden">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="EventFire">
                            <DiscreteStringKeyFrame KeyTime="0:0:2" Value="HiddenComplete"/>
                        </StringAnimationUsingKeyFrames>

                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OuterPanel">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>

                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedTitle">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedText">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="SpeedScore">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="EventFire">
                            <DiscreteStringKeyFrame KeyTime="0:0:2" Value="SpeedScoreComplete"/>
                        </StringAnimationUsingKeyFrames>

                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedTitle">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedText">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="NewPersonalBest">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="EventFire">
                            <DiscreteStringKeyFrame KeyTime="0:0:2" Value="NewPersonalBestComplete"/>
                        </StringAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedTitle">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedText">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PersonalBest">
                    <Storyboard>
                        <StringAnimationUsingKeyFrames Storyboard.TargetProperty="(local:EventFire.EventName)" Storyboard.TargetName="EventFire">
                            <DiscreteStringKeyFrame KeyTime="0:0:2" Value="PersonalBestComplete"/>
                        </StringAnimationUsingKeyFrames>

                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedTitle">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="SpeedText">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <StackPanel>
            <Grid>
                <local:FZTextBlock x:Name="SpeedTitle" Text="SPEED TRAP" Style="{StaticResource A_Style_Text_Title}" HorizontalAlignment="Center" />
            </Grid>
            <Grid>
                <Rectangle Fill="#55FFFFFF" Height="2" Width="275" Grid.Row="1" VerticalAlignment="Bottom" HorizontalAlignment="Center" />
            </Grid>
            <Grid>
                <local:FZTextBlock x:Name="SpeedText" Text="{Binding SpeedScoreText}" Style="{StaticResource A_Style_Text_Body}" Grid.Row="0" HorizontalAlignment="Center" />

                <local:EventFire x:Name="EventFire" />
            </Grid>
        </StackPanel>
    </StackPanel>
</UserControl>
