<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.NIS_R390_98"
	 >
	
    <Page.Resources>
        <Style x:Key="TextBlockStyle" TargetType="{x:Type local:FastTextBlock}">
            <Setter Property="FontFamily" Value="DG2_LCD"/>
            <Setter Property="Foreground" Value="#FFF52233"/>
             
            <Setter Property="TextAlignment" Value="Right"/>
        </Style>
		
		<BooleanToVisibilityConverter x:Key="BoolVisConverter" />
		
		<local:DigitalGaugeConfig x:Key="Config" HasClock="False" HasExternalTemp="False" UseDegreesF="False" UseMPH="False" UsePsi="False" MaxBoost="0" MinBoost="0" MaxSpeed="00" HasAbsLight="False" HasStmLight="False" HasTcsLight="False" HasGAccelX="False" HasGAccelY="False" HasShiftLights="True" HasTextTach="False" HasLapPlaceInfo="True" HasTextBoost="False" HasTextGAccel="False" HasTextOdometer="False" HasTextFuel="False" MaxFuel="0" MaxGear="0" MaxRpm="8000"></local:DigitalGaugeConfig>
		
		<Storyboard x:Key="Shift Lights Progress">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ShiftRed_On">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.75" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.8" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ShiftYellow_On">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.7" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.8" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FLASHING">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.8" Value="{x:Static Visibility.Visible}"/>
			</ObjectAnimationUsingKeyFrames>
		</Storyboard>
		<Storyboard x:Key="Shift Lights Flash" RepeatBehavior="Forever">
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ShiftRed_Flashing">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" Value="{x:Static Visibility.Hidden}"/>
			</ObjectAnimationUsingKeyFrames>
			<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="ShiftYellow_Flashing">
				<DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Visible}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.25" Value="{x:Static Visibility.Hidden}"/>
				<DiscreteObjectKeyFrame KeyTime="0:0:0.5" 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>
	</Page.Resources>
	<Page.Triggers>
		<EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="LayoutRoot">
			<BeginStoryboard Storyboard="{StaticResource Shift Lights Flash}"/>
		</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_Blue" Fill="#FF393939" Height="720" Canvas.Left="0" Canvas.Top="0" Width="1280"/>
        <Rectangle x:Name="Background_ShiftLights" Fill="Black" Height="111" Canvas.Left="383" Canvas.Top="21" Width="508"/>
        <Rectangle x:Name="Background_Gear" Fill="Black" Height="60" Canvas.Left="616" Canvas.Top="381" Width="48"/>
        <Canvas x:Name="Shift_Lights" Height="96" Canvas.Left="440" Canvas.Top="36" Width="404">
        	<Canvas x:Name="OFF" Height="96" Width="404" Canvas.Left="0" Canvas.Top="0">
        		<Image x:Name="ShiftRed_Off" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Red_Off.png" Stretch="Fill" Width="80" Opacity="0.2" Height="80" Canvas.Left="106" Canvas.Top="0"/>
        		<Image x:Name="ShiftYellow_Off" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Yellow_Off.png" Stretch="Fill" Width="80" Opacity="0.2" Height="80" Canvas.Left="160"/>
        	</Canvas>
        	<Canvas x:Name="ON" Height="96" Width="387" Canvas.Left="0" Canvas.Top="0">
        		<Image x:Name="ShiftRed_On" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Red_On.png" Stretch="Fill" Width="80" Height="80" Canvas.Left="106" Canvas.Top="0" Visibility="Hidden"/>
        		<Image x:Name="ShiftYellow_On" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Yellow_On.png" Stretch="Fill" Width="80" Height="80" Canvas.Left="160" Visibility="Hidden"/>
        	</Canvas>
        	<Canvas x:Name="FLASHING" Height="96" Width="387" Canvas.Left="0" Canvas.Top="0" Visibility="Hidden">
        		<Image x:Name="ShiftRed_Flashing" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Red_On.png" Stretch="Fill" Width="80" Height="80" Canvas.Left="106" Canvas.Top="0"/>
        		<Image x:Name="ShiftYellow_Flashing" Source="game:/media/cars/NIS_R390_98/UI/Textures/NIS_R390_98_ShiftLight_Yellow_On.png" Stretch="Fill" Width="80" Height="80" Canvas.Left="160"/>
        	</Canvas>
        </Canvas>
		<Canvas x:Name="Text"
		Height="332" Width="786" RenderTransformOrigin="0.5,0.5" Canvas.Top="248" Canvas.Left="248">
			<Canvas.RenderTransform>
				<TransformGroup>
					<ScaleTransform/>
					<SkewTransform/>
					<RotateTransform/>
					<TranslateTransform/>
				</TransformGroup>
			</Canvas.RenderTransform>
			<local:FastTextBlock x:Name="Text_Gear" Canvas.Left="323" Canvas.Top="139" Width="136.269" FontSize="48" TextAlignment="Center" Style="{StaticResource TextBlockStyle}" Text="{Binding Gear}" RenderTransformOrigin="0.5,0.5"/>
			<local:FastTextBlock x:Name="Text_Gear_Background" Canvas.Left="323" Canvas.Top="139" Width="136.269" FontSize="48" TextAlignment="Center" Style="{StaticResource TextBlockStyle}" Text="8" RenderTransformOrigin="0.5,0.5" Opacity="0.25"/>
		</Canvas>
        <Rectangle x:Name="Start_Up_Mask" Fill="Black" Height="668" Stroke="Black" Width="1186" Canvas.Left="62" Canvas.Top="52" Opacity="0" />

        <!-- Storyboard binding controllers -->
        <local:StoryboardController SeekPct="{Binding Tach}" Target="{StaticResource Shift Lights Progress}"/>
	</Canvas>
</Page>