<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"
    xmlns:ed="http://schemas.microsoft.com/expression/2010/drawing"
    mc:Ignorable="d"
	x:Class="DigitalGauge.RIV_R1T_22"
	 >

    <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="40" MinBoost="1" MaxSpeed="47.2" HasAbsLight="False" HasStmLight="False" HasTcsLight="False" HasGAccelX="True" HasGAccelY="True"  HasShiftLights="False" HasTextTach="False" HasLapPlaceInfo="False" HasTextBoost="False" HasTextGAccel="True" HasTextOdometer="True" HasTextFuel="False" MaxFuel="20" MinGear="-1" MaxGear="1" MaxRpm="5000"/>

        <Storyboard x:Key="Gear Analog">
        	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Textures_RIV_R1S_22_GearD_png">
        		<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        		<DiscreteObjectKeyFrame KeyTime="0:0:0.1" Value="{x:Static Visibility.Visible}"/>
        		<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Visible}"/>
        	</ObjectAnimationUsingKeyFrames>
        	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Textures_RIV_R1S_22_GearN_png">
        		<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
        		<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Hidden}"/>
        	</ObjectAnimationUsingKeyFrames>
        	<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="Textures_RIV_R1S_22_GearR_png">
        		<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
        		<DiscreteObjectKeyFrame KeyTime="0:0:0.1" Value="{x:Static Visibility.Hidden}"/>
        		<DiscreteObjectKeyFrame KeyTime="0:0:1" Value="{x:Static Visibility.Hidden}"/>
        	</ObjectAnimationUsingKeyFrames>
        </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)[0].(ScaleTransform.ScaleX)" Storyboard.TargetName="FuelFill">
				<EasingDoubleKeyFrame KeyTime="0" Value="0.048"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="0.843"/>
			</DoubleAnimationUsingKeyFrames>
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="FuelFill">
				<EasingDoubleKeyFrame KeyTime="0" Value="-31.333"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="1.556"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
        <Storyboard x:Key="G Accel Vertical"/>
        <Storyboard x:Key="G Accel Horizontal"/>
        <Storyboard x:Key="Speed Analog"/>
    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard x:Name="Speed_Analog_BeginStoryboard" Storyboard="{StaticResource Speed 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>
        <Rectangle x:Name="BlackBG" Fill="Black" Height="720.5" Stroke="Black" Width="1281.049"/>
        <Canvas x:Name="CenterConsole" Height="480" Canvas.Left="186" Canvas.Top="299" Width="890" RenderTransformOrigin="0.5,0.5">
        	<Canvas.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="0.7" ScaleY="0.7"/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Canvas.RenderTransform>
        	<Image x:Name="Textures_RIV_R1S_22_Center_png" Height="480" Source="game:/media/cars/RIV_R1T_22/UI/Textures/RIV_R1S_22_Center.png" Stretch="Fill" Width="890"/>
        	<local:FastTextBlock x:Name="Text_Temp" Text="{Binding ExternalTemp}" Height="27.666" Canvas.Left="637.75"   Canvas.Top="23" Width="70.191" FontFamily="DG1_Arial" Foreground="#FFD1D1D1" FontSize="16" TextAlignment="Right" RenderTransformOrigin="0.5,0.5"/>
        	<local:FastTextBlock x:Name="Text_Clock" Text="{Binding Time}" Height="37.666" Canvas.Left="790.929"   Canvas.Top="23.613" Width="70.191" FontFamily="DG1_Arial" Foreground="#FFD1D1D1" FontSize="16" TextAlignment="Right" RenderTransformOrigin="0.5,0.5"/>
        </Canvas>
        <Canvas x:Name="Driver" Height="480" Width="1280" RenderTransformOrigin="0.5,0.5" Canvas.Left="-5.5" Canvas.Top="-55">
        	<Canvas.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="0.75" ScaleY="0.75"/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Canvas.RenderTransform>
        	<Rectangle x:Name="backgroundWhite" Fill="#FFE6E6E6" Height="26.667" Canvas.Left="1185.223" Canvas.Top="434.111" Width="76.111"/>
        	<Canvas x:Name="FuelGauge" Height="26.667" Canvas.Left="1185.223" Canvas.Top="434.111" Width="76.111">
        		<Rectangle x:Name="FuelFill" Fill="#FF3CE237" Height="26.667" Width="76.111" RenderTransformOrigin="0.5,0.5">
        			<Rectangle.RenderTransform>
        				<TransformGroup>
        					<ScaleTransform/>
        					<SkewTransform/>
        					<RotateTransform/>
        					<TranslateTransform/>
        				</TransformGroup>
        			</Rectangle.RenderTransform>
        		</Rectangle>
        	</Canvas>
        	<Image x:Name="Textures_RIV_R1S_22_Driver_png" Height="480" Source="game:/media/cars/RIV_R1T_22/UI/Textures/RIV_R1S_22_Driver.png" Stretch="Fill" Width="1280"/>
        	<Canvas x:Name="Gear" Height="87" Canvas.Left="1138" Canvas.Top="204" Width="20">
        		<Image x:Name="Textures_RIV_R1S_22_GearD_png" Height="20" Source="game:/media/cars/RIV_R1T_22/UI/Textures/RIV_R1S_22_GearD.png" Stretch="Fill" Width="20" Canvas.Top="67"/>
        		<Image x:Name="Textures_RIV_R1S_22_GearN_png" Height="20" Source="game:/media/cars/RIV_R1T_22/UI/Textures/RIV_R1S_22_GearN.png" Stretch="Fill" Width="20" Canvas.Top="34"/>
        		<Image x:Name="Textures_RIV_R1S_22_GearR_png" Height="20" Source="game:/media/cars/RIV_R1T_22/UI/Textures/RIV_R1S_22_GearR.png" Stretch="Fill" Width="20"/>
        	</Canvas>
        	<Canvas x:Name="Text" Height="410.501" Canvas.Left="860.666" Canvas.Top="45.833" Width="297.334">
        		<local:FastTextBlock x:Name="Text_Speed" Text="{Binding Speed}" Height="142.666" Canvas.Left="-31.999"   Canvas.Top="150.5" Width="272.334" FontFamily="Moire" Foreground="Black" FontSize="96" TextAlignment="Right" RenderTransformOrigin="0.5,0.5">
        			<local:FastTextBlock.RenderTransform>
        				<TransformGroup>
        					<ScaleTransform ScaleY="1.75"/>
        					<SkewTransform/>
        					<RotateTransform/>
        					<TranslateTransform/>
        				</TransformGroup>
        			</local:FastTextBlock.RenderTransform>
        		</local:FastTextBlock>
        	</Canvas>		
		
		
        </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 AnalogGear}" Target="{StaticResource Gear Analog}"/>
        <local:StoryboardController SeekPct="{Binding GAccelY}" Target="{StaticResource G Accel Vertical}"/>
        <local:StoryboardController SeekPct="{Binding GAccelX}" Target="{StaticResource G Accel Horizontal}"/>
		<local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
        <local:StoryboardController SeekPct="{Binding AnalogSpeed}" Target="{StaticResource Speed Analog}"/>
    </Canvas>
</Page>