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

    <Style TargetType="FrameworkElement"
           x:Key="A_Style_FrameworkElement_DimOnTagTrue">
        <Style.Triggers>
            <Trigger Property="Tag">
                <Trigger.Value>
                    <System:Boolean>True</System:Boolean>
                </Trigger.Value>
                <!-- BUG 180616 Requested we remove the opacity/dimming. Keeping this code in case we choose to revive this code-->
                <Setter Property="Opacity" Value="1.0" />
            </Trigger>
        </Style.Triggers>
        <Setter Property="Opacity"
                Value="1.0" />
    </Style>
    <!-- Performance Stats Controls -->
    <Style TargetType="local:FZMaterial"
           x:Key="A_Style_FZMaterial_PerformanceStatsDelta"
           BasedOn="{StaticResource A_Style_FZMaterial_DeltaProgressBar_Foreground}">
        <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>0</System:Int32>
                    <!-- 0 IsNeutral -->
                </Trigger.Value>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Stat_Neutral}" />
            </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 BasedOn="{StaticResource A_Style_FZTextBlock_Heading}"
           TargetType="local:FZTextBlock"
           x:Key="A_Style_FZTextBlock_PerformanceStatsDeltaText">
        <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>0</System:Int32>
                    <!-- 0 IsNeutral -->
                </Trigger.Value>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Stat_Neutral_Light}" />
            </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>
        <Setter Property="Color"
                Value="{StaticResource A_Color_SubHeader_Text}" />
        <Setter Property="Preset"
                Value="{StaticResource A_FZMaterialPreset_Matte}" />
    </Style>
    <Thickness x:Key="A_Thickness_Popularity_StarGaps">0,0,3,0</Thickness>
    <System:Double x:Key="A_Double_Popularity_4_Times_StarGaps">12</System:Double>
    <Style TargetType="local:FZMaterial"
           x:Key="A_Style_FZMaterial_PopularityStar">
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tile_Title_Alternate}" />
        <Setter Property="Stretch"
                Value="Uniform" />
        <Setter Property="Width"
                Value="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=local:DeltaProgressBar}}" />
        <Setter Property="Color"
                Value="{StaticResource A_Color_Tile_Title_Alternate}" />
    </Style>
    <Style BasedOn="{StaticResource A_Style_FZMaterial_PopularityStar}"
           TargetType="local:FZMaterial"
           x:Key="A_Style_FZMaterial_PopularityStarBg">
        <Setter Property="ImageSourceNoPreload"
                Value="/ForzaUI;component/Textures/Anthem/Icons/A_Popularity_Star_Large.png" />
        <Style.Triggers>
            <Trigger Property="Tag" Value="Small">
                <Setter Property="ImageSourceNoPreload"
                    Value="/ForzaUI;component/Textures/Anthem/Icons/A_Popularity_Star.png" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style BasedOn="{StaticResource A_Style_FZMaterial_PopularityStar}"
           TargetType="local:FZMaterial"
           x:Key="A_Style_FZMaterial_PopularityStarFg">
        <Setter Property="ImageSourceNoPreload"
                Value="/ForzaUI;component/Textures/Anthem/Icons/A_Popularity_Star_Large.png" />
        <Style.Triggers>
            <Trigger Property="Tag" Value="Small">
                <Setter Property="ImageSourceNoPreload"
                    Value="/ForzaUI;component/Textures/Anthem/Icons/A_Popularity_Star.png" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <local:LinearTransformConverter Add="{StaticResource A_Double_Popularity_4_Times_StarGaps}"
                                    Scale="5"
                                    x:Key="A_RatingConverter" />
    <Style TargetType="{x:Type local:DeltaProgressBar}"
           x:Key="A_Style_DeltaProgressBar_Popularity">
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="Height"
                Value="34" />
        <Setter Property="Width"
                Value="{Binding Height, RelativeSource={RelativeSource Self}, Converter={StaticResource A_RatingConverter}}" />
        <Setter Property="MaxValue"
                Value="5" />
        <Setter Property="local:BindingProxy.A"
                Value="{StaticResource A_Color_DeltaProgressBar_Background}"/>
        <Setter Property="local:BindingProxy.B"
                Value="{StaticResource A_Color_DeltaProgressBar_Foreground}"/>   
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:DeltaProgressBar}">
                    <Grid HorizontalAlignment="Center"
                          VerticalAlignment="Center">
                        <StackPanel Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=local:DeltaProgressBar}}"
                                    HorizontalAlignment="Left"
                                    Orientation="Horizontal"
                                    x:Name="PART_Indicator_Base">
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarBg}"
                                              Color="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarBg}" 
                                              Color="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarBg}" 
                                              Color="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarBg}" 
                                              Color="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PopularityStarBg}" 
                                              Color="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                        </StackPanel>
                        <StackPanel ClipToBounds="True"
                                    Height="{Binding ActualHeight, RelativeSource={RelativeSource AncestorType=local:DeltaProgressBar}}"
                                    HorizontalAlignment="Left"
                                    Orientation="Horizontal"
                                    Width="{Binding BaseValueWidth, RelativeSource={x:Static RelativeSource.TemplatedParent}}"
                                    x:Name="PART_Indicator_Delta">
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarFg}"
                                              Color="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarFg}" 
                                              Color="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarFg}" 
                                              Color="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Margin="{StaticResource A_Thickness_Popularity_StarGaps}"
                                              Style="{StaticResource A_Style_FZMaterial_PopularityStarFg}" 
                                              Color="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PopularityStarFg}" 
                                              Color="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                              Tag="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Drive Train -->
    <Style BasedOn="{StaticResource A_Style_FZTextBlock_Title_Small}"
           TargetType="local:FZTextBlock"
           x:Key="A_Style_FZTextBlock_DriveType">
        <Setter Property="Color"
                Value="{StaticResource A_Color_DeltaProgressBar_Foreground}" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="Stretch"
                Value="Uniform" />
        <Setter Property="StretchDirection"
                Value="DownOnly" />
        <Setter Property="CapHeight"
                Value="19" />
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_DriveTrainDisplay"
        TargetType="Control">
        <Viewbox Stretch="Uniform" StretchDirection="Both">
            <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"
                              Color="{StaticResource A_Color_DriveTrainControl_Background}"
                              Width="128">
                <DockPanel Height="42">
                    <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerInnerRightOnly}"
                                      Color="#FFFFFFFF"
                                      Width="66"
                                      Margin="0,2,2,2"
                                      DockPanel.Dock="Right">
                        <local:FZMaterial x:Name="DriveTrainMaterial"
                            ImageSource="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_PowertrainConverter}, FallbackValue=/ForzaUI;component/Textures/Data_Bound/Drivetrain_Icons/Drivetrain_NULL.png}"
                                          Stretch="Uniform"
                                          GreedyMeasure="True"
                                          Margin="0" />
                    </local:FZMaterial>
                    <local:FZTextBlock x:Name="DriveTrainText"
                                       Style="{StaticResource A_Style_FZTextBlock_DriveType}"
                                       Text="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_PowertrainConverter}, ConverterParameter=text, FallbackValue=???}"
                                       MaxWidth="90"
                                       MaxHeight="40"
                                       TextWrapping="WrapWithOverflow"
                                       Margin="8,8,8,8" />
                </DockPanel>
            </local:FZMaterial>
        </Viewbox>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource Self}}"
                Value="DriveType">
                <Setter TargetName="DriveTrainMaterial" Property="ImageSource" Value="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_DriveTypeConverter}, FallbackValue=/ForzaUI;component/Textures/Data_Bound/Drivetrain_Icons/Drivetrain_NULL.png}" />
                <Setter TargetName="DriveTrainText" Property="Text" Value="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_DriveTypeConverter}, ConverterParameter=text, FallbackValue=???}" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="Control"
           x:Key="A_Style_Control_DriveTrainDisplay">
        <Setter Property="Height" Value="42"/>
        <Setter Property="local:BindingProxy.A" Value="{Binding PowertrainID}"/>
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_DriveTrainDisplay}"/>
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style TargetType="Control"
           x:Key="A_Style_Control_DriveTypeDisplay">
        <Setter Property="Height" Value="42"/>
        <Setter Property="local:BindingProxy.A" Value="{Binding PowertrainID}"/>
        <Setter Property="local:BindingProxy.B" Value="DriveType"/>
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_DriveTrainDisplay}"/>
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                       CornerRadius="0,0,5,5"
                                       x:Key="A_Preset_DrivetrainLowerPanel"/>
    
    <Style TargetType="Control"
           x:Key="A_Style_Control_DriveTrainDisplay_Square">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <Grid>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ShadowBase}" />
                        <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                          Color="#FF969696"
                                          Width="100"
                                          Height="100">

                            <UniformGrid Margin="3"
                                         Rows="2">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_DriveType}"
                                                   CapHeight="25"
                                                   Text="{Binding PowertrainID, Converter={StaticResource A_PowertrainConverter}, ConverterParameter=text, FallbackValue=???}" />
                                <local:FZMaterial Color="#FFFFFFFF"
                                                  Preset="{StaticResource A_Preset_DrivetrainLowerPanel}">
                                    <local:FZMaterial GreedyMeasure="True"
                                                      ImageSource="{Binding PowertrainID, Converter={StaticResource A_PowertrainConverter}, FallbackValue=/ForzaUI;component/Textures/Data_Bound/Drivetrain_Icons/Drivetrain_NULL.png}"
                                                      Stretch="Uniform"
                                                      Margin="3"/>
                                </local:FZMaterial>
                            </UniformGrid>
                        </local:FZMaterial>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
