<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.MER_AMGGTR_17"
	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="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="Gear Analog">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="Gear_Highlight">
				<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="57"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="115"/>
			</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">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_1">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.083" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_2">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.166" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_3">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_4">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.333" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_5">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.418" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_6">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_7">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.583" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_8">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.666" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_9">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.75" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_10">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.833" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_11">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.916" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fuel_Animation_12">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Shape.Fill).(SolidColorBrush.Color)" Storyboard.TargetName="Fuel_Animation_1">
				<EasingColorKeyFrame KeyTime="0:0:0.083" Value="#FFEF2F28"/>
				<EasingColorKeyFrame KeyTime="0:0:0.166" Value="White"/>
			</ColorAnimationUsingKeyFrames>
		</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" Fill="Black" Height="720" Width="804" Canvas.Left="233"/>
        <Rectangle x:Name="Background_Dark" Fill="Black" Height="720" Canvas.Top="0.5" Width="1280"/>
		<Image x:Name="MFD_BG" Height="605" Canvas.Left="338" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_bckgrnd.png" Stretch="Fill" Canvas.Top="107" Width="605"/>
		<Rectangle x:Name="Black_Stripe" Fill="Black" Height="121" Canvas.Left="216" Canvas.Top="594" Width="860"/>
		<Canvas x:Name="Text" Height="720" Width="1280" Canvas.Top="49">
            <TextBlock x:Name="Text_Odometer" Canvas.Left="514.111" Canvas.Top="207.25" Text="{Binding Odometer}" Width="221.528" FontSize="46.667" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap" RenderTransformOrigin="0.5,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="0.9"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <TextBlock x:Name="Text_Trip_Odo" Canvas.Left="533.65" Canvas.Top="303.25" Text="{Binding TripMeter}" Width="165.35" FontSize="46.667" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" TextWrapping="NoWrap"/>
            <TextBlock x:Name="Text_Clock" Canvas.Left="641.75" Canvas.Top="571.749" Text="{Binding Time}" FontSize="48" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="220"/>
            <TextBlock x:Name="Text_External_Temp" Canvas.Left="398" Canvas.Top="571.749" Text="{Binding ExternalTemp}" FontSize="48" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" Width="126.5"/>
            <Image x:Name="TextGraphics_Temp" Height="33" Canvas.Left="529.5" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_Txt_temp.png" Stretch="Fill" Canvas.Top="587.749" Width="41"/>
		</Canvas>
        <Canvas x:Name="Gear_Analog" Height="92" Width="538" Canvas.Left="372" Canvas.Top="8">
        	<Rectangle x:Name="Shift_Background" Fill="#FF1D1E21" Height="118" Canvas.Left="-40" Canvas.Top="-9" Width="612"/>
        	<Image x:Name="Gear_Highlight" Height="57" Canvas.Left="216" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_highlight.png" Stretch="Fill" Canvas.Top="96" Width="54" RenderTransformOrigin="0.5,0.5">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform/>
        				<SkewTransform/>
        				<RotateTransform/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="Shift_Graphics" Height="105" Canvas.Left="96" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_Shift_Bkgd.png" Stretch="Fill" Canvas.Top="75" Width="350"/>
        </Canvas>
		<Canvas x:Name="Fuel_Gauge" Height="411" Canvas.Top="301" Width="1272">
			<Rectangle x:Name="Fuel_Background" Fill="Black" Height="268" Canvas.Top="143" Width="385.333"/>
			<Rectangle x:Name="Fuel_Blue" Fill="#FF8D7EFF" Height="98.5" Canvas.Top="194.5" Width="292" Canvas.Left="34"/>
			<Rectangle x:Name="Fuel_Animation_1" Fill="#FFEF2F28" Height="10.201" Canvas.Left="36.162" Canvas.Top="233.853" Width="27.25" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="36.964"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_2" Fill="White" Height="10.201" Canvas.Left="58.923" Canvas.Top="248.738" Width="26.317" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="31.562"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_3" Fill="White" Height="10.201" Canvas.Left="82.658" Canvas.Top="260.435" Width="24.906" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="23.52"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_4" Fill="White" Height="10.201" Canvas.Left="106.703" Canvas.Top="269.227" Width="23.856" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="17.73"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_5" Fill="White" Height="10.201" Canvas.Left="131.372" Canvas.Top="274.644" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="7.089"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_6" Fill="White" Height="10.201" Canvas.Left="155.376" Canvas.Top="277.312" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="1.872"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_7" Fill="White" Height="11.676" Canvas.Left="179.674" Canvas.Top="276.671" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-2.69"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_8" Fill="White" Height="13.867" Canvas.Left="203.434" Canvas.Top="272.706" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-11.137"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_9" Fill="White" Height="14.498" Canvas.Left="227.665" Canvas.Top="266.592" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-18.932"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_10" Fill="White" Height="15.999" Canvas.Left="250.675" Canvas.Top="256.841" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-27.3"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_11" Fill="White" Height="17.335" Canvas.Left="272.911" Canvas.Top="243.873" Width="22.512" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-37.118"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Fuel_Animation_12" Fill="White" Height="20.213" Canvas.Left="292.359" Canvas.Top="228.351" Width="27.949" RenderTransformOrigin="0.5,0.5" Visibility="Hidden">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-37.118"/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Rectangle x:Name="Temp_Background" Fill="Black" Height="268" Canvas.Top="143" Width="381.333" Canvas.Left="890.667"/>
			<Image x:Name="Fuel_Alpha" Height="108" Canvas.Left="27" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_Fuel.png" Stretch="Fill" Canvas.Top="190" Width="299"/>
			<Image x:Name="Graphics_Temp" Height="108" Canvas.Left="945" Source="game:/media/cars/MER_AMGGTR_17/UI/Textures/MER_AMGGT_15_Temp.png" Stretch="Fill" Canvas.Top="190" Width="299"/>
		</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 Fuel}" Target="{StaticResource Fuel Gauge}"/>
		<local:StoryboardController SeekPct="{Binding AnalogGear}" Target="{StaticResource Gear Analog}"/>
	</Canvas>
</Page>