<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="DigitalGauge.MAS_Ghibli_14"
	DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">
	
    <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" 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="6" MaxRpm="7000"></local:DigitalGaugeConfig>
 		<Storyboard x:Key="Gear Analog">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_N">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.143" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.286" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_1">
				<EasingDoubleKeyFrame KeyTime="0:0:0.143" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.286" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.429" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_2">
				<EasingDoubleKeyFrame KeyTime="0:0:0.286" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.429" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.571" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_3">
				<EasingDoubleKeyFrame KeyTime="0:0:0.429" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.571" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.714" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_4">
				<EasingDoubleKeyFrame KeyTime="0:0:0.571" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.714" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.857" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_R">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.143" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_5">
				<EasingDoubleKeyFrame KeyTime="0:0:0.714" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.857" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Gear_6">
				<EasingDoubleKeyFrame KeyTime="0:0:0.857" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1"/>
			</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="Fuel Gauge">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Fill">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-4"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-6"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.375" Value="-7"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-7"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.625" Value="-7.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="-9"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.875" Value="-6.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1.5"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="Fill">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-17.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-28"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.375" Value="-41.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="-53.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.625" Value="-70.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="-74.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.875" Value="-87"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-110"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill">
				<EasingDoubleKeyFrame KeyTime="0" Value="-14.614"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-11.92"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-7.325"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.375" Value="-3.621"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.625" Value="2.238"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.75" Value="8.89"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.875" Value="12.123"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="-14.614"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-11.92"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-7.325"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-7.325"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Fill_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-4"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-6"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-6"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="Fill_Red">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.125" Value="-17.5"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.25" Value="-28"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-28"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fill_Red">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.125" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<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="Background_Grey" Fill="#FF2D2D2D" Height="720" Canvas.Left="0" Canvas.Top="0" Width="1280" />
		<Rectangle x:Name="Background_Black" Fill="Black" Height="535.43" Canvas.Left="139.836" Canvas.Top="111.035" Width="977.478"/>
		<Canvas x:Name="Fuel_Animation" Height="445.132" Canvas.Left="595.333" Canvas.Top="201.333" Width="458.001">
			<Rectangle x:Name="Background" Fill="#FFA4AAFF" Height="296.667" Canvas.Left="87.334" Canvas.Top="30.667" Width="169.333"/>
			<Rectangle x:Name="Fill" Fill="#FFF4F4F5" Height="200.666" Canvas.Left="123.333" Canvas.Top="244" Width="167.333" RenderTransformOrigin="1,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-14.614"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fill_Red" Fill="#FFFF3870" Height="200.666" Canvas.Left="123.333" Canvas.Top="244" Width="167.333" RenderTransformOrigin="1,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-14.614"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
		</Canvas>
		<Image x:Name="Main_Graphics" Height="340" Canvas.Left="381.575" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_graphics.png" Stretch="Fill" Canvas.Top="208.5" Width="494"/>
		<Canvas x:Name="Shift_Animation" Height="269.5" Canvas.Left="400.5" Canvas.Top="277" Width="509.5">
			<Image x:Name="Gear_R" Height="29" Canvas.Left="215.5" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_R.png" Stretch="Fill" Canvas.Top="210" Width="26" RenderTransformOrigin="0.5,0.5">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Gear_N" Height="29" Canvas.Left="216" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_N.png" Stretch="Fill" Canvas.Top="210" Width="23" RenderTransformOrigin="0.5,0.5" Opacity="0">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Gear_1" Height="29" Canvas.Left="199.664" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D1.png" Stretch="Fill" Canvas.Top="210" Width="50" Opacity="0"/>
			<Image x:Name="Gear_2" Height="29" Canvas.Left="202.661" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D2.png" Stretch="Fill" Canvas.Top="210" Width="50" Opacity="0"/>
			<Image x:Name="Gear_3" Height="29" Canvas.Left="202.661" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D3.png" Stretch="Fill" Canvas.Top="210" Width="50" Opacity="0"/>
			<Image x:Name="Gear_4" Height="29" Canvas.Left="202.494" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D4.png" Stretch="Fill" Canvas.Top="210" Width="51" Opacity="0"/>
			<Image x:Name="Gear_5" Height="30" Canvas.Left="202.328" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D5.png" Stretch="Fill" Canvas.Top="210" Width="50" Opacity="0"/>
			<Image x:Name="Gear_6" Height="29" Canvas.Left="202.323" Source="game:/media/cars/MAS_Ghibli_14/UI/Textures/MAS_Ghibli_14_gear_D6.png" Stretch="Fill" Canvas.Top="210" Width="50" Opacity="0"/>
		</Canvas>
		<Canvas x:Name="Text" Height="720" Width="1280" Canvas.Top="49">
			<TextBlock x:Name="Text_Odometer" Canvas.Left="475.111" Canvas.Top="465.25" Text="{Binding Odometer}" Width="160" FontSize="18.667" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap" RenderTransformOrigin="0.5,0.5" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="0.9"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Speed" Canvas.Left="527.111" Canvas.Top="257.25" Text="{Binding Speed}" Width="200" FontSize="85.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap" RenderTransformOrigin="0.5,0.5" Foreground="White" TextAlignment="Center">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="0.9"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_External_Temp" Canvas.Left="704.111" Canvas.Top="173.75" Text="{Binding ExternalTemp}" Width="100" FontSize="18.667" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap" RenderTransformOrigin="0.5,0.5" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="0.9"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Clock" Canvas.Left="396.611" Canvas.Top="173.75" Text="{Binding Time}" Width="100" FontSize="18.667" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap" RenderTransformOrigin="0.5,0.5" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="0.9"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
		</Canvas>
		<Rectangle x:Name="Fuel_Mask_1" Fill="Black" Height="154.5" Canvas.Left="658" Stroke="Black" Canvas.Top="546.5" Width="299"/>
		<Rectangle x:Name="Fuel_Mask_2" Fill="Black" Height="274" Canvas.Left="874.575" Stroke="Black" Canvas.Top="303.5" Width="173.425"/>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="668" Stroke="Black" Width="1186" Canvas.Left="58" Canvas.Top="52.5" Opacity="0"/>
		
				<!-- Storyboard binding controllers -->
		<local:StoryboardController SeekPct="{Binding AnalogGear}" Target="{StaticResource Gear Analog}"/>
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
	</Canvas>
</Page>