<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.MAZ_MX5_16"
	DataContext="{Binding RelativeSource={x:Static RelativeSource.Self}}">
	
    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="DG2_LCD"/>
            <Setter Property="Foreground" Value="#FF8AC90D"/>
            <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="0" MinBoost="0" MaxSpeed="00" 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="Fuel Gauge">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Needle_Fuel">
				<EasingDoubleKeyFrame KeyTime="0" Value="400.568"/>
				<EasingDoubleKeyFrame KeyTime="0:0:1" Value="319.726"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded">
			<BeginStoryboard Storyboard="{StaticResource Fuel Gauge}"/>
		</EventTrigger>
	</Page.Triggers>
	  

	<Canvas x:Name="LayoutRoot" Background="#FF1C1C1C" Width="1280" Height="720">
		<Image x:Name="Graphics" Height="362" Canvas.Left="227" Source="game:/media/cars/MAZ_MX5_16/UI/Textures/MAZ_MX5_16_graphics.png" Stretch="Fill" Canvas.Top="236" Width="244"/>
		<Image x:Name="Needle_Temp" Height="45" Canvas.Left="347.67" Source="game:/media/cars/MAZ_MX5_16/UI/Textures/MAZ_MX5_16_needle.png" Stretch="Fill" Canvas.Top="267.676" Width="10" RenderTransformOrigin="0.5,-2.46">
			<Image.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform Angle="189.802"/>
					<TranslateTransform X="-5.34" Y="261"/>
				</TransformGroup>
			</Image.RenderTransform>
		</Image>
		<Canvas x:Name="Fuel_Gauge" Height="401.333" Canvas.Left="146.667" Canvas.Top="216.667" Width="401.333">
			<Image x:Name="Needle_Fuel" Height="45" Canvas.Left="200.337" Source="game:/media/cars/MAZ_MX5_16/UI/Textures/MAZ_MX5_16_needle.png" Stretch="Fill" Canvas.Top="57.012" Width="10" RenderTransformOrigin="0.5,-2.6">
				<Image.RenderTransform>
					<TransformGroup>
						<ScaleTransform/>
						<SkewTransform/>
						<RotateTransform Angle="400.568"/>
						<TranslateTransform X="-5.34" Y="261"/>
					</TransformGroup>
				</Image.RenderTransform>
			</Image>
		</Canvas>
		<Canvas x:Name="Text" Height="311" Width="512" Canvas.Left="640" Canvas.Top="177">
			<TextBlock x:Name="Text_Gear" TextAlignment="Center" Text="{Binding Gear}" Width="100" FontSize="64" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Canvas.Top="215" Canvas.Left="149" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.2"/>
						<SkewTransform/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Temperature" TextAlignment="Right" Text="{Binding ExternalTemp}" Width="100" FontSize="40" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Canvas.Top="159" Canvas.Left="-376" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform AngleX="5"/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Odometer" TextAlignment="Right" Text="{Binding Odometer}" Width="150" FontSize="40" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Canvas.Top="229" Canvas.Left="-381" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform AngleX="5"/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
			<TextBlock x:Name="Text_Trip" TextAlignment="Right" Text="{Binding TripMeter}" Width="150" FontSize="40" Style="{StaticResource TextBlockStyle}" RenderTransformOrigin="0.5,0.5" Canvas.Top="276" Canvas.Left="-381" Foreground="White">
				<TextBlock.RenderTransform>
					<TransformGroup>
						<ScaleTransform ScaleX="1.1"/>
						<SkewTransform AngleX="5"/>
						<RotateTransform/>
						<TranslateTransform/>
					</TransformGroup>
				</TextBlock.RenderTransform>
			</TextBlock>
		</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}"/>
	</Canvas>
</Page>