<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_X6M_16">
	
    <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="True" UseMPH="True" 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="731" Canvas.Top="334" Width="309"/>
        <Canvas x:Name="Fuel" Canvas.Left="213" Canvas.Top="277" 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="114"/>
        <Rectangle x:Name="FuelMask_Bottom" Fill="Black" Height="156" Canvas.Left="135" Canvas.Top="444" Width="995"/>
        <Image x:Name="Graphics_Battery" Height="128" Canvas.Left="618" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_battery_mask.png" Stretch="Fill" Canvas.Top="318" Width="512"/>
        <Image x:Name="Graphics_Fuel" Height="128" Canvas.Left="135" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_fuel_mask.png" Stretch="Fill" Canvas.Top="316" Width="512"/>
        <Canvas x:Name="Gear_Analog" Height="134.666" Canvas.Left="559" Canvas.Top="372.667" Width="180">
        	<Image x:Name="Gear_R" Height="54" Canvas.Left="60.5" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_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_X6M_16/UI/Textures/BMW_X6M_16_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_X6M_16/UI/Textures/BMW_X6M_16_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="872.5" Canvas.Top="521.336" Text="{Binding ExternalTemp}" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="200"/>
            <Image x:Name="Text_Speedo_Baked" Height="28" Canvas.Left="423.5" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_txt_speedo.png" Stretch="Fill" Canvas.Top="528" Width="60"/>
            <local:FastTextBlock x:Name="Text_Clock" Canvas.Left="147.164" Canvas.Top="521.336" Text="{Binding Time}" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="150"/>
            <local:FastTextBlock x:Name="Text_Speed" Canvas.Left="273.793" Canvas.Top="502.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="427.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="632.192" Canvas.Top="521.336" Text="{Binding TripMeter}" Width="120" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial"/>
            <local:FastTextBlock x:Name="Text_Odometer" Canvas.Left="557.793" Canvas.Top="521.336" Text="{Binding Odometer}" Width="160" FontSize="25.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextAlignment="Left"/>
            <Image x:Name="Shift_Graphic" Height="44" Canvas.Left="676" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_shift.png" Stretch="Fill" Canvas.Top="426" Width="44"/>
		</Canvas>
        <Image x:Name="Graphics_Time" Height="16" Canvas.Left="218" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_txt_time.png" Stretch="Fill" Canvas.Top="506" Width="80"/>
        <Image x:Name="Graphics_Temperature" Height="44" Canvas.Left="1006" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_txt_temp.png" Stretch="Fill" Canvas.Top="503" Width="100"/>
        <Image x:Name="Graphics_Odometer" Height="16" Canvas.Left="554" Source="game:/media/cars/BMW_X6M_16/UI/Textures/BMW_X6M_16_txt_odo.png" Stretch="Fill" Canvas.Top="505" Width="200"/>
        <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 Fuel}" Target="{StaticResource Fuel Gauge}"/>
		<local:StoryboardController SeekPct="{Binding AnalogGear}" Target="{StaticResource Gear Analog}"/>
	</Canvas>
</Page>