<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.BMW_M6_13">
	
    <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="True" HasExternalTemp="True" UseDegreesF="False" UseMPH="False" UsePsi="True" MaxBoost="13" MinBoost="1" MaxSpeed="120" 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="10000"></local:DigitalGaugeConfig>
		<Storyboard x:Key="Fuel Gauge">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="FuelFill_1">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.1" Value="20"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.2" Value="40"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="60"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="80"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="FuelFill_2">
				<EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="20"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.6" Value="40"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="60"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="80"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="FuelFill_3">
				<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="20"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="42"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1.1" Value="62"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1.2" Value="81"/>
			</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="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:0.75" 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:0.75" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Gear Analog}"/>
		</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="Background_Grey" Fill="Black" Height="720" Width="1280" Canvas.Left="0" Canvas.Top="0"/>
        <Rectangle x:Name="Battery_Fill" Fill="#FF3288E4" Height="100" Canvas.Left="722" Canvas.Top="465" Width="309"/>
        <Canvas x:Name="Fuel" Canvas.Left="214" Canvas.Top="412" Height="224" Width="382">
        	<Rectangle x:Name="FuelFill_1" Fill="#FF3288E4" Height="50" Canvas.Left="72" Canvas.Top="68.5" Width="0" RenderTransformOrigin="0,0.5">
        		<Rectangle.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="32.93"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Rectangle.RenderTransform>
        	</Rectangle>
        	<Rectangle x:Name="FuelFill_2" Fill="#FF3288E4" Height="50" Canvas.Left="146" Canvas.Top="115.5" Width="0" RenderTransformOrigin="0,0.5"/>
        	<Rectangle x:Name="FuelFill_3" Fill="#FF3288E4" Height="50" Canvas.Left="231.5" Canvas.Top="115" Width="0" RenderTransformOrigin="0,0.5">
        		<Rectangle.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform Angle="-27.357"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Rectangle.RenderTransform>
        	</Rectangle>
        </Canvas>
        <Rectangle x:Name="FuelMask_Top" Fill="Black" Height="204" Width="995" Canvas.Left="135" Canvas.Top="257"/>
        <Rectangle x:Name="FuelMask_Bottom" Fill="Black" Height="156" Canvas.Left="148" Canvas.Top="556" Width="995"/>
        <Image x:Name="Graphics_Battery" Height="128" Canvas.Left="609" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_battery_mask.png" Stretch="Fill" Canvas.Top="449" Width="512"/>
        <Image x:Name="Graphics_Fuel" Height="128" Canvas.Left="136" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_fuel_mask.png" Stretch="Fill" Canvas.Top="451" Width="512"/>
		<Canvas x:Name="Shift_Lights" Height="160" Canvas.Left="555" Canvas.Top="429" Width="180">
			<Image x:Name="Shift_1" Height="44" Canvas.Left="119.334" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_shift_1.png" Stretch="Fill" Canvas.Top="63" Width="44"/>
		</Canvas>
        <Canvas x:Name="Gear_Analog" Height="134.666" Canvas.Left="559" Canvas.Top="435.667" Width="180">
        	<Image x:Name="Gear_R" Height="54" Canvas.Left="60.5" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_gear_R.png" Stretch="Fill" Canvas.Top="47.333" Width="54"/>
        	<Image x:Name="Gear_N" Height="54" Canvas.Left="60.5" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_gear_N.png" Stretch="Fill" Canvas.Top="47.333" Width="54" Visibility="Hidden"/>
        	<Image x:Name="Gear_D" Height="54" Canvas.Left="60.5" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_gear_D.png" Stretch="Fill" Canvas.Top="47.333" Width="54" Visibility="Hidden"/>
        </Canvas>
		<Canvas x:Name="Text" Height="720" Width="1280">
            <local:FastTextBlock x:Name="Text_External_Temp" Canvas.Left="803.5" Canvas.Top="582.336" Text="{Binding ExternalTemp}" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="200"/>
            <Image x:Name="Text_Speedo_Baked" Height="24" Canvas.Left="439.5" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_txt_speedo.png" Stretch="Fill" Canvas.Top="581.336" Width="70"/>
            <local:FastTextBlock x:Name="Text_Clock" Canvas.Left="158.164" Canvas.Top="582.336" Text="{Binding Time}" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="150"/>
            <local:FastTextBlock x:Name="Text_Speed" Canvas.Left="286.793" Canvas.Top="558.501" Text="{Binding Speed}" Width="160" FontSize="49.333" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5">
            	<local:FastTextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="0.8"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</local:FastTextBlock.RenderTransform>
            </local:FastTextBlock>
            <local:FastTextBlock x:Name="Text_Gear" Canvas.Left="553.543" Canvas.Top="492.959" Text="{Binding Gear}" Width="100" FontSize="42.667" Style="{StaticResource TextBlockStyle}" Foreground="#FFFBFFDD" RenderTransformOrigin="0.5,0.5" TextAlignment="Center" FontFamily="DG1_Arial">
            	<local:FastTextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="0.9"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</local:FastTextBlock.RenderTransform>
            </local:FastTextBlock>
            <local:FastTextBlock x:Name="Text_Trip_Odo" Canvas.Left="629.192" Canvas.Top="582.336" Text="{Binding TripMeter}" Width="120" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial"/>
            <local:FastTextBlock x:Name="Text_Odometer" Canvas.Left="558.336" Canvas.Top="582.336" Text="{Binding Odometer}" Width="160" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextAlignment="Left"/>
		</Canvas>
        <Image x:Name="Graphics_Time" Height="16" Canvas.Left="234" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_txt_time.png" Stretch="Fill" Canvas.Top="570" Width="80"/>
        <Image x:Name="Graphics_Temperature" Height="44" Canvas.Left="936" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_txt_temp.png" Stretch="Fill" Canvas.Top="565" Width="100"/>
        <Image x:Name="Graphics_Odometer" Height="16" Canvas.Left="554" Source="game:/media/cars/BMW_M6_13/UI/Textures/BMW_M6_13_txt_odo.png" Stretch="Fill" Canvas.Top="568" Width="200"/>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="668" Stroke="Black" Width="1186" Canvas.Left="58" Canvas.Top="53" Opacity="0"/>
		
						<!-- Storyboard binding controllers -->
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
		<local:StoryboardController SeekPct="{Binding AnalogGear}" Target="{StaticResource Gear Analog}"/>
	</Canvas>
</Page>