<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.FER_F151_11"
	DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">
	
    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="DG1_Arial"/>
            <Setter Property="Foreground" Value="White"/>
            <Setter Property="TextWrapping" Value="NoWrap"/>
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
		
		<local:DigitalGaugeConfig x:Key="Config" HasClock="True" HasExternalTemp="True" UseDegreesF="False" UseMPH="False" UsePsi="False" MaxBoost="13" MinBoost="1" MaxSpeed="103" 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" MaxGear="8" MaxRpm="10000"></local:DigitalGaugeConfig>
		<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>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Width)" Storyboard.TargetName="Start_Up_Mask">
				<EasingDoubleKeyFrame KeyTime="0" Value="1280"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1280"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="Start_Up_Mask">
				<EasingDoubleKeyFrame KeyTime="0" Value="720"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="720"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Speedo Analog">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Speedo_Needle">
				<EasingDoubleKeyFrame KeyTime="0" Value="-136"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="99"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Fuel Gauge">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_1">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.1" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_2">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.2" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_3">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.3" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_4">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.4" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_5">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_6">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.6" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_7">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.7" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_8">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.8" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Cell_9">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.9" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Speedo Analog}"/>
			<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>
		<Canvas x:Name="Background" Height="228" Width="1272">
			<Rectangle Fill="Black" Height="230.5" Canvas.Left="5" Canvas.Top="9.5" Width="598.875"/>
			<Rectangle Fill="Black" Height="225.25" Canvas.Left="627.002" Canvas.Top="6" Width="649.831"/>
		</Canvas>
		<Canvas x:Name="Large_Gauges" Height="230" Width="294" Canvas.Left="104" Canvas.Top="244.95" Background="Black">
			<Rectangle x:Name="TopWhite" Fill="White" Height="20" Canvas.Left="0" Canvas.Top="28" Width="294"/>
			<Image x:Name="Race_Text" Height="31.737" Canvas.Left="76" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Race_Text.png" Stretch="Fill" Canvas.Top="21.598" Width="253.902" RenderTransformOrigin="0.5,0.5"/>
			<Rectangle x:Name="Grey" Fill="#FF0E1420" Height="29" Canvas.Left="0" Canvas.Top="183" Width="294"/>
			<Image x:Name="km_Text" Height="16" Canvas.Left="154" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_km_Text.png" Stretch="Fill" Canvas.Top="181.5" Width="128"/>
			<Image x:Name="MFD_Gauges_Lg" Height="127.2" Stretch="Fill" Canvas.Top="54" Width="266.8" Panel.ZIndex="-2" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_MFD_Gauges_Lg.png" Canvas.Left="13.5"/>
			<Image x:Name="OilPressure_Needle" Height="81" Canvas.Left="66.263" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Gauge_Needle.png" Stretch="Fill" Canvas.Top="99.479" Width="20.245" RenderTransformOrigin="0.484,0.276">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="-1" ScaleX="-1"/>
						<SkewTransform AngleY="0" AngleX="0"/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Battery_Needle" Height="81" Canvas.Left="208.163" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Gauge_Needle.png" Stretch="Fill" Canvas.Top="98.999" Width="20.25" RenderTransformOrigin="0.484,0.276">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleY="-1" ScaleX="-1"/>
						<SkewTransform AngleY="0" AngleX="0"/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Canvas x:Name="FuelGauge" Height="14.333" Canvas.Left="35.25" Canvas.Top="186.369" Width="81.333">
				<Rectangle x:Name="Cell_1" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="0" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_2" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="9.327" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_3" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="18.492" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_4" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="27.657" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_5" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="36.822" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_6" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="45.987" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_7" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="55.152" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_8" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="64.317" Canvas.Top="0" Visibility="Hidden"/>
				<Rectangle x:Name="Cell_9" Fill="#FFFF8A0C" Height="14" Width="7" Canvas.Left="73.484" Canvas.Top="0" Visibility="Hidden"/>
			</Canvas>
			<Image x:Name="MFD_Fuel" Height="35.55" Canvas.Left="-9.513" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Fuel.png" Stretch="Fill" Canvas.Top="181.2" Width="146.263"/>
			<TextBlock x:Name="Text_Clock" Canvas.Top="26" Text="{Binding Time}" FontSize="18.667" Style="{StaticResource TextBlockStyle}" Foreground="Black" Width="120" Canvas.Left="-57"/>
			<TextBlock x:Name="Text_External_Temp" Canvas.Left="192" Canvas.Top="26" Text="{Binding ExternalTemp}" FontSize="18.667" Style="{StaticResource TextBlockStyle}" Foreground="Black" Width="52.09" ToolTip=" " Panel.ZIndex="1"/>
			<TextBlock x:Name="Text_Odometer" Canvas.Left="109.833" Canvas.Top="194.033" Text="{Binding Odometer}" Width="98.333" FontSize="16" Style="{StaticResource TextBlockStyle}" Foreground="#FFF0F0F8"/>
			<TextBlock x:Name="Text_Speedo_2" Canvas.Left="196.967" Canvas.Top="194.033" Text="{Binding Speed}" Width="70" FontSize="16" Style="{StaticResource TextBlockStyle}" Foreground="#FFF0F0F8" RenderTransformOrigin="0.5,0.5">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
		</Canvas>
		<Canvas x:Name="Panel_Center" Height="150" Canvas.Left="566" Canvas.Top="285" Width="150" Background="Black">
			<Image Width="30.375" Canvas.Top="74.375" Stretch="Fill" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Gear_arrow.png" x:Name="Gear_arrow" Canvas.Left="28.5" Height="30.375"/>
			<TextBlock x:Name="Text_Gear" TextAlignment="Center" Canvas.Left="53" Canvas.Top="60" Text="{Binding Gear}" Width="55.124" FontSize="48" Style="{StaticResource TextBlockStyle}" Foreground="#FFFFD701" FontFamily="Moire" RenderTransformOrigin="0.5,0.5">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.2"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
		</Canvas>
		<Canvas Width="256" Canvas.Top="232" x:Name="Speedo_Analog" Canvas.Left="904" Height="256">
			<Rectangle x:Name="BG_Speedo" Fill="Black" Height="256" Canvas.Left="-48" Canvas.Top="1" Width="349.875" RenderTransformOrigin="0.5,0.5">
				<Rectangle.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</Rectangle.RenderTransform>
			</Rectangle>
			<Image x:Name="SPEEDO_GRAPHIC" Height="256" Canvas.Left="-1" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Speedo.png" Stretch="Fill" Canvas.Top="1" Width="256"/>
			<TextBlock x:Name="Text_Speed" Canvas.Left="107.15" Canvas.Top="184.062" Text="{Binding Speed}" Width="74.25" FontSize="37.333" Style="{StaticResource TextBlockStyle}" FontFamily="DG1_Arial" RenderTransformOrigin="0.5,0.5" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.5"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<Image x:Name="Speedo_Needle" Height="128" Canvas.Left="112" Source="game:/media/cars/FER_F151_11/UI/Textures/FER_F151_11_Gauge_Needle.png" Stretch="Fill" Canvas.Top="112" Width="32" RenderTransformOrigin="0.484,0.276">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform	ScaleY="-1" ScaleX="-1"/>
						<SkewTransform AngleY="0" AngleX="0"/>
						<RotateTransform Angle="-136"/>
						<TranslateTransform	/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
		</Canvas>
		<Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="720" Stroke="Black" Width="1280" Opacity="0"/>

        <!-- Storyboard binding controllers -->
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
		<local:StoryboardController SeekPct="{Binding AnalogSpeed}" Target="{StaticResource Speedo Analog}"/>
	</Canvas>
</Page>