<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ForzaUI"
	                xmlns:System="clr-namespace:System;assembly=mscorlib">

    <Style x:Key="A_Style_FZTextBlock_PerformanceBarsLabel_CarStats"
                   TargetType="local:FZTextBlock"
                   BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small}">
        <Setter Property="Color" Value="{StaticResource A_Color_DeltaProgressBar_Foreground}" />
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="MaxWidth" Value="200" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="FontSize"
                Value="24" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_CarStats"
           TargetType="local:DeltaProgressBar">
        <Setter Property="Margin" Value="0,0,0,13"/>
        <Setter Property="Focusable" Value="False" />
        <Setter Property="MaxValue" Value="10" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:DeltaProgressBar}">
                    <DockPanel>
                        <local:FZMaterial DockPanel.Dock="Right"
                                          Style="{StaticResource A_Style_FZMaterial_StatValueContainer_CarStats}"
                                          VerticalAlignment="Bottom"
                                          TextElement.FontFamily="Horizon_A"
                                          MinWidth="43"
                                          x:Name="ValuePanel">
                            <local:FZMaterial CaptureSubgraph="True"
                                Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}">
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TitleShadow}">
                                    <local:FZTextBlock Text="{Binding NewValue, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_NumUnitConverter_NoUnit_1dp}}"
                                                       Style="{StaticResource A_Style_FZTextBlock_PerformanceStatsDeltaText_CarStats}"
                                                       HorizontalAlignment="Center"
                                                       x:Name="ValueText"/>
                                </local:FZMaterial>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <DockPanel TextElement.FontFamily="Horizon_A"
                                   Margin="0,0,22,0">
                            <Grid DockPanel.Dock="Bottom"
                                  Height="8">
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_DeltaProgressBar_Background}" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_DeltaProgressBar_Foreground}"
                                                  x:Name="Old">
                                    <local:FZMaterial.RenderTransform>
                                        <ScaleTransform ScaleX="{Binding BaseRatio, RelativeSource={RelativeSource TemplatedParent}}" />
                                    </local:FZMaterial.RenderTransform>
                                </local:FZMaterial>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_DeltaProgressBar_Foreground}"
                                                  x:Name="New">
                                    <local:FZMaterial.RenderTransform>
                                        <ScaleTransform ScaleX="{Binding NewRatio, RelativeSource={RelativeSource TemplatedParent}}" />
                                    </local:FZMaterial.RenderTransform>
                                </local:FZMaterial>
                            </Grid>
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PerformanceBarsLabel_CarStats}"
                                               Text="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_StringToUpper}}"
                                               Margin="0,0,-10,0" />
                        </DockPanel>
                    </DockPanel>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding NewValue, RelativeSource={RelativeSource Self}, Converter={StaticResource A_CompareConverter}, ConverterParameter=9.95}"
                                     Value="1">
                            <Setter Property="Text"
                                    TargetName="ValueText"
                                    Value="10" />
                        </DataTrigger>
                        <Trigger Property="Change"
                                 Value="-1">
                            <Setter Property="Color"
                                    TargetName="Old"
                                    Value="{StaticResource A_Color_Stat_Negative}" />
                            <Setter Property="Color"
                                    TargetName="ValuePanel"
                                    Value="{StaticResource A_Color_Stat_Negative}" />
                            <Setter Property="Color"
                                    TargetName="ValueText"
                                    Value="{StaticResource A_Color_Stat_Neutral_Light}" />
                            <Setter Property="Margin"
                                    TargetName="Old"
                                    Value="0" />
                        </Trigger>
                        <Trigger Property="Change"
                                 Value="0">
                            <Setter Property="Margin"
                                    TargetName="Old"
                                    Value="0" />
                        </Trigger>
                        <Trigger Property="Change"
                                 Value="1">
                            <Setter Property="Panel.ZIndex"
                                    TargetName="Old"
                                    Value="1" />
                            <Setter Property="Color"
                                    TargetName="New"
                                    Value="{StaticResource A_Color_Stat_Positive}" />
                            <Setter Property="Color"
                                    TargetName="ValuePanel"
                                    Value="{StaticResource A_Color_Stat_Positive}" />
                            <Setter Property="Color"
                                    TargetName="ValueText"
                                    Value="{StaticResource A_Color_Stat_Neutral_Light}" />
                            <Setter Property="Margin"
                                    TargetName="New"
                                    Value="0" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PerformanceStatsDeltaText_CarStats"
                   TargetType="{x:Type local:FZTextBlock}"
                   BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Large_Tight}">
        <Setter Property="Color" Value="{StaticResource A_Color_DeltaProgressBar_Text}" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="Stretch" Value="None" />
        <Setter Property="FontFamily" Value="Horizon_A" />
        <Setter Property="FontSize" Value="24"/>
        <Setter Property="Margin" Value="8"/>
    </Style>
    
    <Style x:Key="A_Style_FZTextBlock_UpgradeStat_TextBackground"
                   TargetType="{x:Type local:FZMaterial}"
           BasedOn="{StaticResource A_Style_FZMaterial_CarSelectCarouselItem_StatusIconBackground}">
        <Style.Triggers>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Int32>-1</System:Int32>
                    <!-- -1 IsDowngrade -->
                </Trigger.Value>
                <Setter Property="Color" Value="{StaticResource A_Color_Stat_Negative}" />
            </Trigger>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Int32>1</System:Int32>
                    <!-- 1 IsUpgrade -->
                </Trigger.Value>
                <Setter Property="Color" Value="{StaticResource A_Color_Stat_Positive}" />
            </Trigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="A_Style_FZTextBlock_UpgradeStat_TextForeground"
                   TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Color" Value="{StaticResource A_Color_Header_Text}" />
        <Style.Triggers>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Int32>-1</System:Int32>
                    <!-- -1 IsDowngrade -->
                </Trigger.Value>
                <Setter Property="Color" Value="{StaticResource A_Color_SubHeader_Text}" />
            </Trigger>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Int32>0</System:Int32>
                    <!-- 0 IsNeutral -->
                </Trigger.Value>
                <Setter Property="Color" Value="{StaticResource A_Color_Header_Text}" />
            </Trigger>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Int32>1</System:Int32>
                    <!-- 1 IsUpgrade -->
                </Trigger.Value>
                <Setter Property="Color" Value="{StaticResource A_Color_Header_Text}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_StatValueContainer_CarStats"
           BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Base}"
           TargetType="local:FZMaterial">
        <Setter Property="Color" Value="{StaticResource A_Color_DeltaProgressBar_Foreground}" />
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Comparison_CarStats"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}"
           TargetType="local:DeltaProgressBar">
        <Style.Triggers>
            <DataTrigger Binding="{Binding Upgraded}"
                         Value="{x:Null}">
                <Setter Property="BaseValue">
                    <Setter.Value>
                        <System:Double>0</System:Double>
                    </Setter.Value>
                </Setter>
                <Setter Property="NewValue">
                    <Setter.Value>
                        <System:Double>0</System:Double>
                    </Setter.Value>
                </Setter>
            </DataTrigger>
            <DataTrigger Binding="{Binding Current}"
                         Value="{x:Null}">
                <Setter Property="BaseValue"
                        Value="{Binding NewValue, RelativeSource={RelativeSource Self}}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Upgrades_Speed"
           TargetType="local:DeltaProgressBar"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_Comparison_CarStats}">
        <Setter Property="BaseValue"
                Value="{Binding Current.SpeedRating}" />
        <Setter Property="NewValue"
                Value="{Binding Upgraded.SpeedRating}" />
        <Setter Property="Tag"
                Value="{local:Loc CarFlow.IDS_Stat_Speed}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Upgrades_Handling"
           TargetType="local:DeltaProgressBar"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_Comparison_CarStats}">
        <Setter Property="BaseValue"
                Value="{Binding Current.HandlingRating}" />
        <Setter Property="NewValue"
                Value="{Binding Upgraded.HandlingRating}" />
        <Setter Property="Tag"
                Value="{local:Loc CarFlow.IDS_Stat_Handling}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Upgrades_Acceleration"
           TargetType="local:DeltaProgressBar"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_Comparison_CarStats}">
        <Setter Property="BaseValue"
                Value="{Binding Current.AccelerationRating}" />
        <Setter Property="NewValue"
                Value="{Binding Upgraded.AccelerationRating}" />
        <Setter Property="Tag"
                Value="{local:Loc CarFlow.IDS_Stat_Accel}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Upgrades_Launch"
           TargetType="local:DeltaProgressBar"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_Comparison_CarStats}">
        <Setter Property="BaseValue"
                Value="{Binding Current.LaunchRating}" />
        <Setter Property="NewValue"
                Value="{Binding Upgraded.LaunchRating}" />
        <Setter Property="Tag"
                Value="{local:Loc CarFlow.IDS_Stat_Launch}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Upgrades_Braking"
           TargetType="local:DeltaProgressBar"
           BasedOn="{StaticResource A_Style_DeltaProgressBar_Comparison_CarStats}">
        <Setter Property="BaseValue"
                Value="{Binding Current.BrakingRating}" />
        <Setter Property="NewValue"
                Value="{Binding Upgraded.BrakingRating}" />
        <Setter Property="Tag"
                Value="{local:Loc CarFlow.IDS_Stat_Braking}" />
    </Style>

   
    <Style x:Key="A_Style_DeltaProgressBar_Compare_Speed" TargetType="local:DeltaProgressBar"
                   BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}">
        <Setter Property="BaseValue" Value="{Binding Current.SpeedRating}" />
        <Setter Property="NewValue" Value="{Binding Upgraded.SpeedRating}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Compare_Handling" TargetType="local:DeltaProgressBar"
                   BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}">
        <Setter Property="BaseValue" Value="{Binding Current.HandlingRating}" />
        <Setter Property="NewValue" Value="{Binding Upgraded.HandlingRating}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Compare_Acceleration" TargetType="local:DeltaProgressBar"
                   BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}">
        <Setter Property="BaseValue" Value="{Binding Current.AccelerationRating}" />
        <Setter Property="NewValue" Value="{Binding Upgraded.AccelerationRating}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Compare_Launch" TargetType="local:DeltaProgressBar"
                   BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}">
        <Setter Property="BaseValue" Value="{Binding Current.LaunchRating}" />
        <Setter Property="NewValue" Value="{Binding Upgraded.LaunchRating}" />
    </Style>

    <Style x:Key="A_Style_DeltaProgressBar_Compare_Braking" TargetType="local:DeltaProgressBar"
                   BasedOn="{StaticResource A_Style_DeltaProgressBar_CarStats}">
        <Setter Property="BaseValue" Value="{Binding Current.BrakingRating}" />
        <Setter Property="NewValue" Value="{Binding Upgraded.BrakingRating}" />
    </Style>

    <Style x:Key="A_Style_TextBlock_BenchmarkSectionHeader"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Minimum}">
        <Setter Property="Color"
                Value="#FFFFFFFF" />
        <Setter Property="Margin"
                Value="0" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>

    <Style x:Key="A_Style_Grid_BenchmarkStatRow"
           TargetType="Grid">
        <Setter Property="Margin"
                Value="0,13,0,0" />
    </Style>

    <Style x:Key="A_Style_TextBlock_BenchmarkStatLabel"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Body_Text}" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="FontFamily"
                Value="Horizon_B" />
        <Setter Property="CapHeight"
                Value="20" />
    </Style>

    <Style x:Key="A_Style_TextBlock_BenchmarkStatValue"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_Heading_Small}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Body_Text}" />
        <Setter Property="Margin"
                Value="0,0,0,0" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Right" />
    </Style>

    <ControlTemplate TargetType="Control"
                     x:Key="A_Template_Control_Benchmark">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="2*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="1.5*" />
                <RowDefinition Height="*" />
                <RowDefinition Height="1.5*" />
            </Grid.RowDefinitions>
            <UniformGrid Grid.Row="0"
                         Rows="4">
                <local:FZTextBlock Text="{local:Loc Benchmark.IDS_ACCELERATION_SPEED}"
                                   Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                <Grid >
                    <local:FZTextBlock Text="{Binding Accel60Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding Accel60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
                <Grid >
                    <local:FZTextBlock Text="{Binding Accel100Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding Accel100Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
                <Grid >
                    <local:FZTextBlock Text="{local:Loc Benchmark.IDS_TopSpeed}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding TopSpeedStat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
            </UniformGrid>

            <local:FZMaterial Grid.Row="1"
                              Style="{StaticResource A_Style_FZMaterial_GlassPanel_HorizontalDivider}" />

            <UniformGrid Grid.Row="2"
                         Rows="3">
                <local:FZTextBlock Text="{local:Loc Benchmark.IDS_BRAKING_DISTANCE}"
                                   Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                <Grid >
                    <local:FZTextBlock Text="{Binding Brake60Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding Brake60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
                <Grid >
                    <local:FZTextBlock Text="{Binding Brake100Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding Brake100Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
            </UniformGrid>

            <local:FZMaterial Grid.Row="3"
                              Style="{StaticResource A_Style_FZMaterial_GlassPanel_HorizontalDivider}" />

            <UniformGrid Grid.Row="4"
                         Rows="3">
                <local:FZTextBlock Text="{local:Loc Benchmark.IDS_LATERAL_Gs}"
                                   Style="{StaticResource A_Style_TextBlock_BenchmarkSectionHeader}" />
                <Grid >
                    <local:FZTextBlock Text="{Binding LatG60Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding LatG60Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
                <Grid >
                    <local:FZTextBlock Text="{Binding LatG120Label}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatLabel}" />
                    <local:FZTextBlock Text="{Binding LatG120Stat}"
                                       Style="{StaticResource A_Style_TextBlock_BenchmarkStatValue}" />
                </Grid>
            </UniformGrid>
        </Grid>
    </ControlTemplate>
    
</ResourceDictionary>