<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.RAM_TRX_24"
	 >

    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type local:FastTextBlock}">
            <Setter Property="FontFamily" Value="DG1_Arial"/>
            <Setter Property="Foreground" Value="White"/>
             
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>

        <local:DigitalGaugeConfig x:Key="Config" HasClock="False" HasExternalTemp="True" UseDegreesF="True" UseMPH="True" UsePsi="True" MaxBoost="13" MinBoost="1" MaxSpeed="53.64" 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="7000"></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>
        </Storyboard>
        <Storyboard x:Key="Tach">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="RAM_TRX_24_NeedleTach">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-58"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="138"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Speed Analog">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="RAM_TRX_24_NeedleSpeedo">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-130"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="55"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Key="Fuel Gauge">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="FuelFill1">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-90"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-180"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="FuelFill1">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-100"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-38.5"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="FuelFill1">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-100"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-173"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="FuelFill2">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-90"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="-90"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="-90"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:1" Value="-107.642"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)" Storyboard.TargetName="FuelFill2">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-100"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="-97"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="-86.5"/>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="FuelFill2">
        		<EasingDoubleKeyFrame KeyTime="0" Value="-100"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.7" Value="-55"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.8" Value="-54.5"/>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </Page.Resources>
    <Page.Triggers>
        <EventTrigger RoutedEvent="FrameworkElement.Loaded">
            <BeginStoryboard Storyboard="{StaticResource Tach}"/>
            <BeginStoryboard x:Name="Speed_Analog_BeginStoryboard" Storyboard="{StaticResource Speed Analog}"/>
            <BeginStoryboard x:Name="Fuel_Gauge_BeginStoryboard" Storyboard="{StaticResource Fuel Gauge}"/>
        </EventTrigger>
    </Page.Triggers>


    <Canvas x:Name="LayoutRoot" Background="Black" Width="1280" Height="720">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="NightDaySplit">
                <VisualState x:Name="Day"/>
                <VisualState x:Name="Night"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>

        <!-- Storyboard binding controllers -->
        <Image x:Name="RAM_TRX_24_Center" Height="800" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Center.png" Stretch="Fill" Width="500" RenderTransformOrigin="0.5,0.5" Canvas.Left="392" Canvas.Top="163">
        	<Image.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="0.6" ScaleY="0.6"/>
        			<SkewTransform/>
        			<RotateTransform Angle="-90"/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Image.RenderTransform>
        </Image>

        <!-- Storyboard binding controllers -->
        <Canvas x:Name="DriverGroup" Height="500" Width="1280" ClipToBounds="True" RenderTransformOrigin="0.5,0.5" Canvas.Top="-40">
        	<Canvas.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="0.75" ScaleY="0.75"/>
        			<SkewTransform/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</Canvas.RenderTransform>
        	<Canvas x:Name="FuelGroup" Height="489" Canvas.Left="845" Canvas.Top="-8" Width="400">
        		<Rectangle x:Name="FuelBG" Fill="#FF1A1A1A" Height="134.5" Canvas.Left="294.5" Canvas.Top="354.5" Width="104"/>
        		<Image x:Name="FuelFill1" Height="400" Source="game:/media/cars/RAM_TRX_24/UI/Textures/Arc_White.png" Stretch="Fill" Width="400" RenderTransformOrigin="1,1">
        			<Image.RenderTransform>
        				<TransformGroup>
        					<ScaleTransform ScaleX="0.5" ScaleY="0.5"/>
        					<SkewTransform/>
        					<RotateTransform Angle="-90"/>
        					<TranslateTransform X="-100" Y="-100"/>
        				</TransformGroup>
        			</Image.RenderTransform>
        		</Image>
        		<Image x:Name="FuelFill2" Height="400" Source="game:/media/cars/RAM_TRX_24/UI/Textures/Arc_White.png" Stretch="Fill" Width="400" RenderTransformOrigin="1,1">
        			<Image.RenderTransform>
        				<TransformGroup>
        					<ScaleTransform ScaleX="0.5" ScaleY="0.5"/>
        					<SkewTransform/>
        					<RotateTransform Angle="-90"/>
        					<TranslateTransform X="-100" Y="-100"/>
        				</TransformGroup>
        			</Image.RenderTransform>
        		</Image>
        	</Canvas>
        	<Image x:Name="RAM_TRX_24_Driver" Height="500" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Driver.png" Stretch="Fill" Width="1280"/>
        	<Image x:Name="RAM_TRX_24_Tach" Height="432" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Tach.png" Stretch="Fill" Width="432" Canvas.Left="33" RenderTransformOrigin="0.5,0.5" Canvas.Top="59">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="0.9" ScaleX="0.9"/>
        				<SkewTransform/>
        				<RotateTransform/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="RAM_TRX_24_NeedleTach" Height="432" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Needle.png" Stretch="Fill" Width="432" Canvas.Left="33" RenderTransformOrigin="0.5,0.5" Canvas.Top="59">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="0.9" ScaleX="0.9"/>
        				<SkewTransform/>
        				<RotateTransform Angle="-58"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="RAM_TRX_24_Speedo" Height="432" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Speedo.png" Stretch="Fill" Width="432" RenderTransformOrigin="0.5,0.5" Canvas.Left="817" Canvas.Top="59">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="0.9" ScaleX="0.9"/>
        				<SkewTransform/>
        				<RotateTransform/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        	<Image x:Name="RAM_TRX_24_NeedleSpeedo" Height="432" Source="game:/media/cars/RAM_TRX_24/UI/Textures/RAM_TRX_24_Needle.png" Stretch="Fill" Width="432" RenderTransformOrigin="0.5,0.5" Canvas.Left="817" Canvas.Top="59">
        		<Image.RenderTransform>
        			<TransformGroup>
        				<ScaleTransform ScaleY="0.9" ScaleX="0.9"/>
        				<SkewTransform/>
        				<RotateTransform Angle="-130"/>
        				<TranslateTransform/>
        			</TransformGroup>
        		</Image.RenderTransform>
        	</Image>
        </Canvas>
        <local:FastTextBlock x:Name="Text_Speed" Text="{Binding Speed}" Height="106.667" Canvas.Left="480"   Canvas.Top="158.665" Width="309.333" FontFamily="Moire" Foreground="White" FontSize="64" TextAlignment="Center" RenderTransformOrigin="0.5,0.5">
        	<local:FastTextBlock.RenderTransform>
        		<TransformGroup>
        			<ScaleTransform ScaleX="1.5" ScaleY="1.1"/>
        			<SkewTransform AngleX="-12"/>
        			<RotateTransform/>
        			<TranslateTransform/>
        		</TransformGroup>
        	</local:FastTextBlock.RenderTransform>
        </local:FastTextBlock>
        <local:FastTextBlock x:Name="Text_Odometer"  Text="{Binding Odometer}" Height="19.333" Canvas.Left="720.75"   Canvas.Top="363.667" Width="109" FontFamily="DG1_Arial" Foreground="White" TextAlignment="Right" FontSize="16"/>
        <local:FastTextBlock x:Name="Text_Gear" Height="26.666" Canvas.Left="262.5"   Canvas.Top="358.834" Width="109" FontFamily="DG1_Arial" Foreground="White" TextAlignment="Center" FontSize="21.333"/>
        <local:FastTextBlock x:Name="Text_ExternalTemp" Text="{Binding ExternalTemp}" Height="25.333" Canvas.Left="720.75"   Canvas.Top="65.5" Width="109" FontFamily="DG1_Arial" Foreground="White" TextAlignment="Right" FontSize="21.333"/>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="720" Stroke="Black" Width="1280" Canvas.Left="0" Canvas.Top="0" Opacity="0"/>
        <local:StoryboardController SeekPct="{Binding Tach}" Target="{StaticResource Tach}"/>
        <local:StoryboardController SeekPct="{Binding AnalogSpeed}" Target="{StaticResource Speed Analog}"/>
        <local:StoryboardController SeekPct="{Binding Fuel}" Target="{StaticResource Fuel Gauge}"/>
    </Canvas>
</Page>