<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.TES_ModelS_14">
	
    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="Moire"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="TextWrapping" Value="Wrap"/>
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
		
		<local:DigitalGaugeConfig x:Key="Config" HasTachMem="True" HasClock="True" HasExternalTemp="True" UseDegreesF="True" UseMPH="True" UsePsi="True" MaxBoost="13" MinBoost="1" MaxSpeed="80" HasAbsLight="False" HasStmLight="False" HasTcsLight="False" HasGAccelX="False" HasGAccelY="False" HasShiftLights="False" HasTextTach="False" HasLapPlaceInfo="False" HasTextBoost="False" HasTextGAccel="False" HasTextOdometer="True" HasTextFuel="False" MaxFuel="20" MinGear="-1" MaxGear="1" MaxRpm="5000"></local:DigitalGaugeConfig>
        
		<Storyboard x:Key="Tach">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Tach_Color">
				<EasingDoubleKeyFrame KeyTime="0" Value="90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="13.861"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<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="Gear Analog">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Shift_R">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Shift_N">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Shift_D">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Speedo Analog">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Needle1">
				<EasingDoubleKeyFrame KeyTime="0" Value="-148.989"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.056" Value="-134.018"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.112" Value="-119.05"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.167" Value="-104.293"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.222" Value="-90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.277" Value="-74.827"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.333" Value="-59.976"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.389" Value="-46.335"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.444" Value="-33.951"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-23.878"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.556" Value="-15.376"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.611" Value="-8.635"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.667" Value="-3.586"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.722" Value="2.678"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="2.678"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Color_1">
				<EasingDoubleKeyFrame KeyTime="0" Value="-149.504"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.056" Value="-133.975"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.112" Value="-118.951"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.167" Value="-104.224"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.222" Value="-90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.277" Value="-74.886"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.333" Value="-60.127"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.389" Value="-46.503"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.444" Value="-34.277"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-24.052"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.556" Value="-15.462"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.611" Value="-8.885"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.667" Value="-3.883"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.722" Value="2.678"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="2.678"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Color_2">
				<EasingDoubleKeyFrame KeyTime="0" Value="-149.514"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.056" Value="-133.975"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.112" Value="-119.951"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.167" Value="-104.224"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.222" Value="-90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.277" Value="-74.886"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.333" Value="-60.127"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-60.127"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Fuel Gauge">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Fuel_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="4.571"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Fuel_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="6.25"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Yellow">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.05" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Fuel_Yellow">
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="1.469"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="2.594"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Fuel_Yellow">
				<EasingDoubleKeyFrame KeyTime="0:0:0.05" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="3.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="12.75"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Green">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Fuel_Green">
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1.416"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="1.837"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="2.258"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="2.702"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="3.123"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="3.544"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="3.965"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="4.433"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Fuel_Green">
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="8.75"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="17.583"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="26.416"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="35.749"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="44.582"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="53.415"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="62.248"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="72.081"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Gear Analog}"/>
			<BeginStoryboard Storyboard="{StaticResource Speedo Analog}"/>
			<BeginStoryboard Storyboard="{StaticResource Fuel Gauge}"/>
		</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="Black_Background" Fill="Black" Height="720" Stroke="Black" Width="1280" Canvas.Top="0"/>
        <Image x:Name="Background_Speedo_Alph" Height="400" Canvas.Left="436.667" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Background_Alpha.png" Stretch="Fill" Canvas.Top="156.004" Width="400"/>
        <Canvas x:Name="Speedo_Color" Height="452" Canvas.Left="410" Canvas.Top="127" Width="452">
        	<Image x:Name="Color_1" Height="196" Canvas.Left="31.168" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Speedo_Color.png" Stretch="Fill" Canvas.Top="33.001" Width="196" RenderTransformOrigin="1,1">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="-149.504"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="Color_2" Height="196" Canvas.Left="31.168" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Speedo_Color.png" Stretch="Fill" Canvas.Top="33.001" Width="196" RenderTransformOrigin="1,1">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="-149.514"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        </Canvas>
        <Canvas x:Name="Tach" Canvas.Left="384.667" Canvas.Top="105" Height="512" Width="512">
        	<Image x:Name="Tach_Color" Height="196" Canvas.Left="252.5" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Tach_Color.png" Stretch="Fill" Canvas.Top="55.833" Width="195" RenderTransformOrigin="0,1">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="90"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        </Canvas>
        <Image x:Name="Background_Main" Height="480" Canvas.Left="0" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Background.png" Stretch="Fill" Canvas.Top="118.059" Width="1280"/>
		<Canvas x:Name="PRND" Height="122" Canvas.Left="536" Canvas.Top="442" Width="185">
			<Image x:Name="Shift_R" Height="35" Canvas.Left="54.997" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Shift_R.png" Stretch="Fill" Canvas.Top="49.333" Width="92"/>
			<Image x:Name="Shift_N" Height="35" Canvas.Left="54.997" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Shift_N.png" Stretch="Fill" Canvas.Top="49.333" Width="92" Visibility="Hidden"/>
			<Image x:Name="Shift_D" Height="35" Canvas.Left="54.997" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Shift_D.png" Stretch="Fill" Canvas.Top="49.333" Width="92" Visibility="Hidden"/>
		</Canvas>
		<Canvas x:Name="Speedo_Needle" Height="482" Canvas.Left="393" Canvas.Top="114" Width="482">
			<Image x:Name="Needle1" Height="97" Canvas.Left="224" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_Speedo_Needle.png" Stretch="Fill" Canvas.Top="31" Width="40" RenderTransformOrigin="0.5,2.172">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-148.989"/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
		</Canvas>
		<Canvas x:Name="Fuel_Animation" Height="401.333" Canvas.Left="436.667" Canvas.Top="158.667" Width="401.333">
			<Rectangle x:Name="Fuel_Grey" Fill="#FF505050" Height="48" Canvas.Left="96.666" Canvas.Top="186" Width="200"/>
			<Rectangle x:Name="Fuel_Red" Fill="#FFB70000" Height="39.833" Canvas.Left="104.666" Canvas.Top="186" Width="3.5" RenderTransformOrigin="0.5,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Yellow" Fill="#FFFEFF20" Height="39.833" Canvas.Left="104.666" Canvas.Top="186" Width="16" Visibility="Hidden" RenderTransformOrigin="0.5,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Green" Fill="#FF009404" Height="39.833" Canvas.Left="104.666" Canvas.Top="186" Width="42" Visibility="Hidden" RenderTransformOrigin="0.5,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Image x:Name="Hub" Height="235" Canvas.Left="83.333" Source="game:/media/cars/tes_models_14/UI/Textures/TES_ModelS_14_CenterHub.png" Stretch="Fill" Canvas.Top="79.332" Width="235"/>
		</Canvas>
		<Canvas x:Name="Text" Height="720" Width="1280">
			<TextBlock x:Name="Text_Trip_Odo" Canvas.Left="201.709" Canvas.Top="555.333" Text="{Binding TripMeter}" Width="98.333" FontSize="21.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial"/>
			<TextBlock x:Name="Text_Speedo_Black" Canvas.Left="539.709" Canvas.Top="258.999" Text="{Binding Speed}" Width="200" FontSize="72" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextAlignment="Center" Foreground="Black"/>
			<TextBlock x:Name="Text_Speedo_White" Canvas.Left="536.709" Canvas.Top="255" Text="{Binding Speed}" Width="200" FontSize="72" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextAlignment="Center"/>
			<TextBlock x:Name="Text_External_Temp" Canvas.Left="303.709" Canvas.Top="555.333" Text="{Binding ExternalTemp}" Width="98.333" FontSize="21.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" RenderTransformOrigin="0.5,0.5">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="0.92"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Clock" Canvas.Left="952.709" Canvas.Top="555.333" Text="{Binding Time}" Width="98.333" FontSize="21.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial"/>
		</Canvas>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="668" Stroke="Black" Width="1186" Canvas.Left="56" Canvas.Top="52" Opacity="0"/>
		
				<!-- Storyboard binding controllers -->
		<local:StoryboardController SeekPct="{Binding Tach}" Target="{StaticResource Tach}"/>
		<local:StoryboardController SeekPct="{Binding AnalogGear}" Target="{StaticResource Gear Analog}"/>
		<local:StoryboardController SeekPct="{Binding AnalogSpeed}" Target="{StaticResource Speedo Analog}"/>
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
		<local:StoryboardController SeekPct="{Binding AnalogSpeed}" Target="{StaticResource Speedo Analog}"/>
	</Canvas>
</Page>