<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.AST_DB11_17">
	
    <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="False" HasClock="True" HasExternalTemp="True" UseDegreesF="True" UseMPH="True" UsePsi="True" MinBoost="0" MaxBoost="0" MaxSpeed="90.82" 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.6" MinGear="-1" MaxGear="1" MaxRpm="8700.0"></local:DigitalGaugeConfig>
        
		<Storyboard x:Key="Tach">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Needle">
				<EasingDoubleKeyFrame KeyTime="0" Value="-120.209"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.92" Value="120.118"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="120.118"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Fuel Gauge">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Fuel_Fill">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="Fuel_Fill_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.132" Value="0.132"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Fill_Red">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.132" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.133" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Low_Icon">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.132" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.133" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
		</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="Gear_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="Gear_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="Gear_D">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Gear Analog}"/>
		</EventTrigger>
	</Page.Triggers>
	
		<local:EventFire.FzTriggers>
        <local:EventFireTrigger Event="StartUp" Storyboard="{StaticResource Start Up Animation}"/>
    </local:EventFire.FzTriggers>
 
	<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="Background_Black" Fill="Black" Height="720" Stroke="Black" Width="1280" Canvas.Left="0" Canvas.Top="0" />
        <Canvas x:Name="Tach_Animation" Height="720" Canvas.Left="0" Canvas.Top="0" Width="1280">
        	<Image x:Name="GT_Icon" Height="74" Canvas.Left="888.667" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_GT_icon.png" Stretch="Fill" Canvas.Top="448.001" Width="74"/>
        	<Image x:Name="Shocks_Icon" Height="74" Canvas.Left="320.004" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_shocks_icon.png" Stretch="Fill" Canvas.Top="448.001" Width="74"/>
        	<Image x:Name="Tach_Graphics" Height="372" Canvas.Left="453.999" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_tach_graphics.png" Stretch="Fill" Canvas.Top="174.001" Width="372"/>
        	<Image x:Name="Needle" Height="56" Canvas.Left="611.75" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_tach_needle.png" Stretch="Fill" Canvas.Top="197" Width="56" RenderTransformOrigin="0.5,2.911">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="-120.209"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        </Canvas>
		<Canvas x:Name="Fuel_Animation" Height="408" Canvas.Top="120" Width="448">
			<Rectangle x:Name="Fuel_Background" Fill="#FF4E6865" Height="24" Canvas.Left="160" Stroke="Black" Canvas.Top="174.834" Width="176"/>
			<Rectangle x:Name="Fuel_Fill" Height="29.166" Canvas.Left="187" Canvas.Top="175.584" Width="140.849" Fill="#FFDAFDFD" RenderTransformOrigin="0,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="0"/>
						<SkewTransform AngleX="-40"/>
						<RotateTransform/>
						<TranslateTransform X="-1.542"/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Fill_Red" Height="29.166" Canvas.Left="187" Canvas.Top="175.584" Width="140.849" Fill="#FFFD4943" RenderTransformOrigin="0,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="0"/>
						<SkewTransform AngleX="-40"/>
						<RotateTransform/>
						<TranslateTransform X="-1.542"/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Image x:Name="Fuel_Graphics" Height="82" Canvas.Left="140" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_fuel_graphics.png" Stretch="Fill" Canvas.Top="173.5" Width="207"/>
			<Image x:Name="Fuel_Low_Icon" Height="20" Canvas.Left="148" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_fuel_low.png" Stretch="Fill" Canvas.Top="178.334" Width="24" Visibility="Hidden"/>
		</Canvas>
		<Canvas x:Name="Gear_Animation" Height="216" Canvas.Left="480" Canvas.Top="272" Width="312">
			<Image x:Name="Gear_R" Height="17" Canvas.Left="120.999" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_gear_R.png" Stretch="Fill" Canvas.Top="113.007" Width="80"/>
			<Image x:Name="Gear_N" Height="17" Canvas.Left="120.999" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_gear_N.png" Stretch="Fill" Canvas.Top="113.007" Width="80" Visibility="Hidden"/>
			<Image x:Name="Gear_D" Height="17" Canvas.Left="120.999" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_gear_D.png" Stretch="Fill" Canvas.Top="113.007" Width="80" Visibility="Hidden"/>
		</Canvas>
		<Canvas x:Name="Text" Height="720" Width="1280">
			<TextBlock x:Name="Text_Speed" Canvas.Left="540" Canvas.Top="294" Text="{Binding Speed}" Width="200" FontSize="50.667" Style="{StaticResource TextBlockStyle}" TextAlignment="Center" RenderTransformOrigin="0.5,0.5" FontFamily="DG1_Arial" Foreground="Black"/>
			<TextBlock x:Name="Text_Temperature" Canvas.Left="938.666" Canvas.Top="468.249" Text="{Binding ExternalTemp}" Width="100" FontSize="21.333" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Foreground="White" FontFamily="DG1_Arial"/>
			<Image x:Name="Graphic_Temperature" Height="20" Canvas.Left="1038.666" Source="game:/media/cars/AST_DB11_17/UI/Textures/AST_DB11_17_Temp_txt.png" Stretch="Fill" Canvas.Top="473.999" Width="22"/>
			<TextBlock x:Name="Text_Time" Canvas.Left="157.997" Canvas.Top="468.249" Text="{Binding Time}" Width="100" FontSize="21.333" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Foreground="White" FontFamily="DG1_Arial"/>
		</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 AnalogGear}" Target="{StaticResource Gear Analog}"/>
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
	</Canvas>
</Page>