<Page
	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:System="clr-namespace:System;assembly=mscorlib"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:ForzaUI"
    mc:Ignorable="d"
	x:Class="ForzaUI.TOY_151_SupraGRFD_20">

    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type local:FastTextBlock}">
            <Setter Property="FontFamily" Value="Moire"/>
            <Setter Property="Foreground" Value="White"/>
             
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>

        <local:DigitalGaugeConfig x:Key="Config" HasClock="False" HasExternalTemp="False" UseDegreesF="True" UseMPH="True" UsePsi="False" MaxBoost="13" MinBoost="1" MaxSpeed="120" HasAbsLight="False" HasStmLight="False" HasTcsLight="False" HasGAccelX="False" HasGAccelY="False" HasShiftLights="True" HasTextTach="False" HasLapPlaceInfo="False" HasTextBoost="False" HasTextGAccel="False" HasTextOdometer="False" HasTextFuel="False" MaxFuel="29.0" MaxGear="6" MaxRpm="9000"></local:DigitalGaugeConfig>
        <Storyboard x:Key="Start Up Animation">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Start_Up_Mask">
                <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Shift Lights Progress">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FLASHING">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Visible}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GreenLight_1_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GreenLight_2_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.628" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="YellowLight_1_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.654" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="YellowLight_2_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.68" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_1_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.709" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_2_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.737" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_3_On">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.768" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.813" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Shift Lights Flash" RepeatBehavior="Forever">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GreenLight_1_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="GreenLight_2_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="YellowLight_1_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="YellowLight_2_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_1_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_2_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="RedLight_3_Flashing">
                <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
                <DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
            </ObjectAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Tach">
            <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.ClipToBounds)" Storyboard.TargetName="Tach">
                <DiscreteBooleanKeyFrame KeyTime="0" Value="True"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.25" Value="True"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.5" Value="True"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:0.75" Value="True"/>
                <DiscreteBooleanKeyFrame KeyTime="0:0:1" Value="True"/>
            </BooleanAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="Tach">
                <EasingDoubleKeyFrame KeyTime="0" Value="30"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="190"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="380"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="600"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="850"/>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="LayoutRoot">
            <BeginStoryboard Storyboard="{StaticResource Shift Lights Flash}"/>
            <BeginStoryboard Storyboard="{StaticResource Tach}"/>
        </EventTrigger>
    </Page.Triggers>


    <Canvas x:Name="LayoutRoot" Background="Transparent" Width="1280" Height="720">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="NightDaySplit">
                <VisualState x:Name="Day"/>
                <VisualState x:Name="Night"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Rectangle x:Name="Grey_Background" Fill="Black" Height="720" Width="1280" Canvas.Left="0" Canvas.Top="0"/>
        <Rectangle x:Name="Background_Shift_Lights" Fill="Black" Height="107" Canvas.Left="349" Canvas.Top="24" Width="600"/>
        <Canvas x:Name="Shift_Lights" Height="92" Width="600" Canvas.Left="356" Canvas.Top="29.5">
            <Canvas x:Name="OFF" Height="92" Width="600">
                <Image x:Name="GreenLight_1_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="53" Opacity="0.25"/>
                <Image x:Name="GreenLight_2_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="109" Opacity="0.25"/>
                <Image x:Name="YellowLight_1_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="165" Opacity="0.25"/>
                <Image x:Name="YellowLight_2_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="220" Opacity="0.25"/>
                <Image x:Name="RedLight_1_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="276" Opacity="0.25"/>
                <Image x:Name="RedLight_2_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="332" Opacity="0.25"/>
                <Image x:Name="RedLight_3_Off" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_Off.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="389" Opacity="0.25"/>
            </Canvas>
            <Canvas x:Name="ON" Height="92" Width="600">
                <Image x:Name="GreenLight_1_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="53" Visibility="Hidden"/>
                <Image x:Name="GreenLight_2_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="109" Visibility="Hidden"/>
                <Image x:Name="YellowLight_1_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="165" Visibility="Hidden"/>
                <Image x:Name="YellowLight_2_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="220" Visibility="Hidden"/>
                <Image x:Name="RedLight_1_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="276" Visibility="Hidden"/>
                <Image x:Name="RedLight_2_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="332" Visibility="Hidden"/>
                <Image x:Name="RedLight_3_On" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="389" Visibility="Hidden"/>
            </Canvas>
            <Canvas x:Name="FLASHING" Height="92" Width="600" Visibility="Hidden">
                <Image x:Name="GreenLight_1_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="53"/>
                <Image x:Name="GreenLight_2_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_GreenLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="109"/>
                <Image x:Name="YellowLight_1_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="165"/>
                <Image x:Name="YellowLight_2_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_YellowLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="220"/>
                <Image x:Name="RedLight_1_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="276"/>
                <Image x:Name="RedLight_2_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="332"/>
                <Image x:Name="RedLight_3_Flashing" Height="128" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/CHE_4_CorvetteZR1_11_RedLight_On.PNG" Stretch="Fill" Width="128" Canvas.Top="-15" Canvas.Left="389"/>
            </Canvas>
        </Canvas>
        <Rectangle x:Name="Tach_BG" Fill="#FF151515" Height="338.5" Canvas.Left="200.5" Stroke="Black" Canvas.Top="131" Width="892"/>
        <Canvas x:Name="Tach" Height="547.15" Canvas.Left="200.5" Canvas.Top="131" Width="892">
            <Image x:Name="Textures_TOY_411_CorollaFD_19_Tach_png" Height="547.15" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/TOY_411_CorollaFD_19_Tach.png" Stretch="Fill" Width="892"/>
        </Canvas>
        <Image x:Name="Textures_TOY_411_CorollaFD_19_BG_png" Height="547.15" Source="game:/media/cars/TOY_151_SupraGRFD_20/UI/Textures/TOY_411_CorollaFD_19_BG.png" Stretch="Fill" Width="892" Canvas.Left="200.5" Canvas.Top="131"/>
        <Canvas x:Name="Text" Height="720" Width="1280">
            <local:FastTextBlock x:Name="Text_Speed" Height="76" Canvas.Left="274.025"   Text="{Binding Speed}" Canvas.Top="150.667" Width="191.308" FontSize="72" FontFamily="DG1_Arial" Foreground="White" TextAlignment="Center" RenderTransformOrigin="0.5,0.5">
                <local:FastTextBlock.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform X="5.885"/>
                    </TransformGroup>
                </local:FastTextBlock.RenderTransform>
            </local:FastTextBlock>
        </Canvas>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="720" Stroke="Black" Width="1280" Canvas.Left="0" Canvas.Top="0" Opacity="0"/>

        <!-- Storyboard binding controllers -->
        <local:StoryboardController SeekPct="{Binding Tach}" Target="{StaticResource Tach}"/>
        <local:StoryboardController SeekPct="{Binding Tach}" Target="{StaticResource Shift Lights Progress}"/>
    </Canvas>
</Page>