<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_CaliforniaT_15"
	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="False" HasExternalTemp="True" UseDegreesF="False" UseMPH="False" UsePsi="False" MaxBoost="-.8" MinBoost="1.3" MaxSpeed="100" HasAbsLight="False" HasStmLight="False" HasTcsLight="False" HasGAccelX="False" HasGAccelY="False" HasShiftLights="False" HasTextTach="False" HasLapPlaceInfo="False" HasTextBoost="True" HasTextGAccel="False" HasTextOdometer="True" HasTextFuel="False" MaxFuel="20" MinGear="0" MaxGear="0" MaxRpm="10000"></local:DigitalGaugeConfig>
		<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>
		<Storyboard x:Key="Start Up Animation">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Start_Up_Graphics">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="Mask_ALL">
				<EasingDoubleKeyFrame KeyTime="0" Value="1"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Boost Analog">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill_1">
				<EasingDoubleKeyFrame KeyTime="0" Value="-90"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.111" Value="-58.525"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.221" Value="-28.431"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.328" Value="-1.573"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fill_2">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.328" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.329" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.555" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.655" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill_2">
				<EasingDoubleKeyFrame KeyTime="0:0:0.329" Value="-1.573"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.333" Value="1.812"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.444" Value="31.566"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.555" Value="61.537"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.655" Value="87.572"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fill_3">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.655" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.656" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill_3">
				<EasingDoubleKeyFrame KeyTime="0:0:0.656" Value="87.572"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.666" Value="91.295"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.776" Value="121.191"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.888" Value="151.588"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.984" Value="177.89"/>
			</DoubleAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Fill_4">
				<DiscreteObjectKeyFrame KeyTime="0:0:0.984" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.985" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Fill_4">
				<EasingDoubleKeyFrame KeyTime="0:0:0.985" Value="177.89"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="181.259"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Boost Analog}"/>
		</EventTrigger>
	</Page.Triggers>
	
	<local:EventFire.FzTriggers>
        <local:EventFireTrigger Event="StartUp" Storyboard="{StaticResource Start Up Animation}"/>
    </local:EventFire.FzTriggers>

	<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" Canvas.Left="0" Canvas.Top="0" Width="1280"/>
		
        <Canvas x:Name="Background" Height="100" Width="100">
        	<Rectangle x:Name="GEAR_BCKGD2" Fill="Black" Height="224" Canvas.Left="484" Canvas.Top="248" Width="224"/>
        	<Rectangle x:Name="ShiftLights_Background" Fill="Black" Height="160" Canvas.Left="0" Canvas.Top="4" Width="1280"/>
        </Canvas>
        <Canvas x:Name="Large_Gauges" Height="192" Width="400" Canvas.Left="36" Canvas.Top="268">
        	<Image x:Name="MFD_Background" Height="229" Canvas.Left="54" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_MFD.png" Stretch="Fill" Canvas.Top="-22" Width="294" RenderTransformOrigin="0.5,0.5">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleX="1.5" ScaleY="1.5"/>
        				<SkewTransform/>
        				<RotateTransform/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="OilPressure_Needle" Height="114.916" Canvas.Left="80.559" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Gauge_Needle.png" Stretch="Fill" Canvas.Top="65.93" Width="28.729" RenderTransformOrigin="0.484,0.276">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="-1" ScaleX="-1"/>
        				<SkewTransform AngleY="0" AngleX="0"/>
        				<RotateTransform Angle="-36.213"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="Battery_Needle" Height="114.916" Canvas.Left="278.85" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Gauge_Needle.png" Stretch="Fill" Canvas.Top="65.18" Width="28.729" RenderTransformOrigin="0.484,0.276">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="-1" ScaleX="-1"/>
        				<SkewTransform AngleY="0" AngleX="0"/>
        				<RotateTransform Angle="-77.594"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        </Canvas>
		<Canvas x:Name="Turbo" Height="500" Canvas.Left="718" Canvas.Top="103" Width="500">
			<Image x:Name="Fill_1" Height="128" Canvas.Left="122" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Turbo_fill.png" Stretch="Fill" Canvas.Top="262" Width="128" RenderTransformOrigin="1,0">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-90"/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Fill_2" Height="128" Canvas.Left="122" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Turbo_fill.png" Stretch="Fill" Canvas.Top="262" Width="128" RenderTransformOrigin="1,0" Visibility="Hidden">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="-1.573"/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Fill_3" Height="128" Canvas.Left="122" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Turbo_fill.png" Stretch="Fill" Canvas.Top="262" Width="128" RenderTransformOrigin="1,0" Visibility="Hidden">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="87.572"/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Fill_4" Height="128" Canvas.Left="122" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Turbo_fill.png" Stretch="Fill" Canvas.Top="262" Width="128" RenderTransformOrigin="1,0" Visibility="Hidden">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="177.89"/>
						<TranslateTransform/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
			<Image x:Name="Graphics" Height="298" Canvas.Left="101" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Turbo_graphics.png" Stretch="Fill" Canvas.Top="113" Width="298"/>
		</Canvas>
        <Canvas x:Name="Fuel" Canvas.Left="54" Canvas.Top="455.25" Height="40.25" Width="136.833">
        	<Rectangle x:Name="Cell_1" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="14.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_2" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="26.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_3" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="38.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_4" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="50.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_5" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="62.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_6" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="74.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_7" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="86.725" Canvas.Top="15.413" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_8" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="98.725" Canvas.Top="15.55" Visibility="Hidden"/>
        	<Rectangle x:Name="Cell_9" Fill="#FFEF8700" Height="16.7" Width="8" Canvas.Left="110.725" Canvas.Top="15.413" Visibility="Hidden"/>
        </Canvas>
        <Image x:Name="Gear_arrow" Height="48" Canvas.Left="526" Source="game:/media/cars/FER_CaliforniaT_15/UI/Textures/FER_CaliforniaT_15_Gear_arrow.png" Stretch="Fill" Canvas.Top="359" Width="48"/>
		<Canvas x:Name="Text" Height="720" Width="1280" Canvas.Left="12">
            <TextBlock x:Name="Text_External_Temp" Canvas.Left="248.41" Canvas.Top="221" Text="{Binding ExternalTemp}" FontSize="28" Style="{StaticResource TextBlockStyle}" Foreground="White" Width="120" ToolTip=" " RenderTransformOrigin="0.5,0.5" FontFamily="Moire">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="1.2" ScaleY="0.9"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <TextBlock x:Name="Text_Clock" Canvas.Left="1059.2" Canvas.Top="192" Text="{Binding Time}" FontSize="29.333" Style="{StaticResource TextBlockStyle}" Foreground="White" RenderTransformOrigin="0.5,0.5" Width="150" FontFamily="Moire">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleY="0.9"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <TextBlock x:Name="Text_Speed" Canvas.Left="245" Canvas.Top="473" Text="{Binding Speed}" Width="94.75" FontSize="33.333" Style="{StaticResource TextBlockStyle}" FontFamily="Moire" RenderTransformOrigin="0.5,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="1.2"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <TextBlock x:Name="Text_Gear" TextAlignment="Center" Canvas.Left="564" Canvas.Top="322" Text="{Binding Gear}" Width="72" FontSize="74.667" Style="{StaticResource TextBlockStyle}" Foreground="#FFFF3D0B" FontFamily="Moire" RenderTransformOrigin="0.5,0.5">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleX="1.3"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
            <TextBlock x:Name="Text_Trip_Odo" Canvas.Left="305" Canvas.Top="481.793" Text="{Binding TripMeter}" Width="130" FontSize="24" Style="{StaticResource TextBlockStyle}" FontFamily="Moire"/>
            <TextBlock x:Name="Text_Boost" Canvas.Left="872.41" Canvas.Top="372" Text="{Binding BoostText}" FontSize="66.667" Style="{StaticResource TextBlockStyle}" Foreground="White" Width="200" ToolTip=" " RenderTransformOrigin="0.5,0.5" FontFamily="Moire">
            	<TextBlock.RenderTransform>
            		<TransformGroup>
            			<ScaleTransform ScaleY="0.9"/>
            			<SkewTransform/>
            			<RotateTransform/>
            			<TranslateTransform/>
            		</TransformGroup>
            	</TextBlock.RenderTransform>
            </TextBlock>
		</Canvas>
		<Canvas x:Name="Start_Up_Graphics" Height="721" Width="1280" Visibility="Hidden">
			<Canvas x:Name="Masks" Height="720" Canvas.Left="0" Canvas.Top="0" Width="1280">
				<Rectangle x:Name="Mask_ALL" Fill="Black" Height="720" Canvas.Left="0" Width="1280" Canvas.Top="0" Opacity="0"/>
			</Canvas>
		</Canvas>
		
		<!-- Storyboard binding controllers -->
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
        <local:StoryboardController SeekPct="{Binding BoostAnim}" Target="{StaticResource Boost Analog}"/>
	</Canvas>
</Page>