<ResourceDictionary
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:System="clr-namespace:System;assembly=mscorlib"
	xmlns:local="clr-namespace:ForzaUI"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" >

    <Thickness x:Key="A_Thickness_Margin_PlayerBar">36,44,36,0</Thickness>
    <Thickness x:Key="A_Thickness_Margin_ButtonBar">72,0,72,51</Thickness>

    <Thickness x:Key="A_Thickness_Margin_BigPlayerBar">78,0,78,0</Thickness>

    <System:Double x:Key="A_Double_PlayerBar_PrestigeIcon_Width">54</System:Double>
    <System:Double x:Key="A_Double_PlayerBar_PrestigeIcon_Height">34</System:Double>

    <Style x:Key="A_Style_FZTextBlock_PlayerBar" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
        <Setter Property="Color" Value="White" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="CapHeight" Value="18"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PlayerBarThin" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonF}">
        <Setter Property="Color" Value="White" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="CapHeight" Value="18"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PlayerBarBold" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonC}">
        <Setter Property="Color" Value="White" />
        <Setter Property="HorizontalAlignment" Value="Center" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="CapHeight" Value="15"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PlayerBar_CurrencyValueText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_PlayerBarBold}">
        <Setter Property="Margin" Value="12"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PlayerBar_ProgressBarText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_PlayerBar_CurrencyValueText}">
        <Setter Property="Visibility" Value="Visible"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource AncestorType=local:PlayerBarControl}}" Value="is_in_map" />
                    <Condition Binding="{Binding ShowProgressBarTextInMap}" Value="False" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Hidden"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <System:Double x:Key="A_Double_Size_PlayerBar">44</System:Double>
    <System:Double x:Key="A_Double_Size_PlayerBar_Height">34</System:Double>
    <System:Double x:Key="A_Double_Size_BigPlayerBar">200</System:Double>

    <Style x:Key="A_Style_FrameworkElement_PlayerBar_Container"
        TargetType="{x:Type FrameworkElement}">
        <Setter Property="MinWidth" Value="{StaticResource A_Double_Size_PlayerBar}" />
        <Setter Property="MinHeight" Value="{StaticResource A_Double_Size_PlayerBar}" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_PlayerBar_CurrencyContainer"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FrameworkElement_PlayerBar_Container}">
        <Setter Property="Color" Value="#ffffff" />
        <Setter Property="Preset" Value="{StaticResource H_Roundtangle_LeftOnly_3px}" />
    </Style>

    <local:MappingConverter x:Key="A_Converter_CurrencyValueContainerBackgroundColor"
                            Default="{StaticResource A_Color_DarkenedBar_Background}">
        <local:MappingConverterEntry Key="False" Value="{StaticResource A_Color_CurrencyValueContainer_Dark}" />
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_PlayerBar_CurrencyValueContainer"
           TargetType="{x:Type local:FZMaterial}"
           BasedOn="{StaticResource A_Style_FrameworkElement_PlayerBar_Container}">
        <Setter Property="Tag" Value="{Binding ShowPlayerAndCarInfo, RelativeSource={RelativeSource FindAncestor, AncestorType=local:PlayerBarControl}, Converter={StaticResource A_Converter_CurrencyValueContainerBackgroundColor}}"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Glass_Purple_40pc}" />
        <Setter Property="Preset" Value="{StaticResource H_GlassRoundtangle_RightOnly_3px}" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_PlayerBar_CarInfoBackground"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource A_Color_DarkenedBar_Background}"/>
        <Setter Property="MinWidth" Value="{StaticResource A_Double_Size_PlayerBar}" />
        <Setter Property="MinHeight" Value="{StaticResource A_Double_Size_PlayerBar_Height}" />
        <Setter Property="Preset" Value="{StaticResource H_GlassRoundtangle_Low_1px}" />
    </Style>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangleStroke_PlayerBar_PlayerNameBackground"
                                       AlphaMode="Cutout" 
                                       BasedOn="{StaticResource H_Roundtangle_RightOnly_1px}"/>

    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerNameBackground"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource A_Color_DarkenedBar_Background}"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangleStroke_PlayerBar_PlayerNameBackground}" />
    </Style>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_PlayerLevelBase_Dynamic"
                                       BasedOn="{DynamicResource H_Roundtangle_LeftOnly_1px}" />

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier10"
                                       BasedOn="{DynamicResource A_FZMaterialPresetRoundtangle_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#961f0a"
                                       GradientColorB="#df7a45"
                                       GradientAngle="45"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier11"
                                       BasedOn="{DynamicResource A_FZMaterialPresetRoundtangle_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#949faf"
                                       GradientColorB="#fafafb"
                                       GradientAngle="45"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier12"
                                       BasedOn="{DynamicResource A_FZMaterialPresetRoundtangle_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#bf6c11"
                                       GradientColorB="#feff61"
                                       GradientAngle="45"/>

    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Default"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{DynamicResource A_FZMaterialPresetRoundtangle_FlatPanel_PlayerLevelBase_Dynamic}" />
        <Setter Property="Color" Value="{Binding XP, Converter={StaticResource A_XPConverter}}" />
    </Style>
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier1" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier2" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier3" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier4" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier5" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier6" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier7" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier8" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier9" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Default}" />
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier10"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier10}" />
        <Setter Property="Color" Value="#FFFFFF" />
    </Style>
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier11"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier11}" />
        <Setter Property="Color" Value="#FFFFFF" />
    </Style>
    <Style x:Key="A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier12"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_PlayerBar_PlayerBackground_Tier12}" />
        <Setter Property="Color" Value="#FFFFFF" />
    </Style>

    <local:MappingConverter x:Key="A_Converter_XpToPlayerBar_FZMaterialStyle">
        <local:MappingConverterEntry Key="Tier1" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier1}"/>
        <local:MappingConverterEntry Key="Tier2" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier2}"/>
        <local:MappingConverterEntry Key="Tier3" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier3}"/>
        <local:MappingConverterEntry Key="Tier4" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier4}"/>
        <local:MappingConverterEntry Key="Tier5" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier5}"/>
        <local:MappingConverterEntry Key="Tier6" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier6}"/>
        <local:MappingConverterEntry Key="Tier7" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier7}"/>
        <local:MappingConverterEntry Key="Tier8" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier8}"/>
        <local:MappingConverterEntry Key="Tier9" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier9}"/>
        <local:MappingConverterEntry Key="Tier10" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier10}"/>
        <local:MappingConverterEntry Key="Tier11" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier11}"/>
        <local:MappingConverterEntry Key="Tier12" Value="{StaticResource A_Style_FZMaterial_PlayerBar_PlayerBackground_Tier12}"/>
    </local:MappingConverter>

    <local:WristbandConverter x:Key="A_WristbandConverter_PlayerBarStyle" 
                       StyleConverter="{StaticResource A_Converter_XpToPlayerBar_FZMaterialStyle}" />

    <local:XPConverter x:Key="A_XPConverter_PlayerBarStyle" 
                       StyleConverter="{StaticResource A_Converter_XpToPlayerBar_FZMaterialStyle}" />


    <local:FZMaterialPresetRoundtangle x:Key="A_Preset_FlatPanel_PlayerLevelBase_Dynamic"
                                       BasedOn="{Roundtangle CornerRadius=14}" />

    <local:FZMaterialPresetRoundtangle x:Key="A_Preset_PlayerBar_PlayerBackground_Tier10"
                                       BasedOn="{DynamicResource A_Preset_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#961f0a"
                                       GradientColorB="#df7a45"
                                       GradientAngle="45"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_Preset_PlayerBar_PlayerBackground_Tier11"
                                       BasedOn="{DynamicResource A_Preset_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#949faf"
                                       GradientColorB="#fafafb"
                                       GradientAngle="45"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_Preset_PlayerBar_PlayerBackground_Tier12"
                                       BasedOn="{DynamicResource A_Preset_FlatPanel_PlayerLevelBase_Dynamic}"
                                       GradientColorA="#bf6c11"
                                       GradientColorB="#feff61"
                                       GradientAngle="45"/>


    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PlayerBar_Gamerpic"
                                       CornerRadius="0,0,0,0" />

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_PlayerBar_GamerpicBorder"
                                       CornerRadius="0,0,0,0" />

    <Style x:Key="A_Style_FZMaterial_PlayerBar_GamerpicBackground"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_PlayerBar_GamerpicBorder}" />
    </Style>

    <System:Double x:Key="A_Double_Size_PlayerBar_Padding">16</System:Double>
    
    <Thickness x:Key="A_Margin_PlayerBarText">12,2,12,2</Thickness>

    <Size x:Key="A_Size_PlayerBar_GamerPicSizeParams">44,44</Size>

    <ExponentialEase x:Key="A_EasingFunction_ProgressBar_BlendValue_CareerChanged" EasingMode="EaseIn"/>
    <local:OffsetKeyTime x:Key="A_KeyTime_ProgressBar_CareerProgression_BlendValueEnd_Relative"
                         KeyTime="0:0:0.0" />
    <local:UIStoryboard x:Key="A_Storyboard_ProgressBar_BlendValueInputChanged_CareerProgression">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="{x:Null}"
                                       FillBehavior="HoldEnd"
                                       Storyboard.TargetProperty="(local:BlendValue.Blend)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="0" />
            <EasingDoubleKeyFrame KeyTime="{StaticResource A_KeyTime_ProgressBar_CareerProgression_BlendValueEnd_Relative}"
                                  Value="1"
                                  EasingFunction="{StaticResource A_EasingFunction_ProgressBar_BlendValue_CareerChanged}" />
        </DoubleAnimationUsingKeyFrames>
    </local:UIStoryboard>

    <Style x:Key="A_Style_FZMaterial_EndOfProgressBar_Visual"
            TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Width" Value="3"/>
        <Setter Property="Height" Value="{StaticResource A_Double_Size_PlayerBar_Height}" />
        <Setter Property="HorizontalAlignment" Value="Right" />
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
        <Setter Property="Preset" Value="{StaticResource H_GlassRoundtangle_RightOnly_3px}" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_ProgressIndicator"
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Blue}" />
    </Style>

    <Style x:Key="A_Style_ProgressBar_CareerProgression"
                TargetType="{x:Type ProgressBar}">
        <Setter Property="Height" Value="{StaticResource A_Double_Size_PlayerBar_Height}"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ProgressBar}">
                    <DockPanel>
                        <FZMaterial x:Name="endOfProgressBar_visual" DockPanel.Dock="Right"
                            Style="{StaticResource A_Style_FZMaterial_EndOfProgressBar_Visual}" />
                        <Grid>
                            <local:FZMaterial x:Name="PART_Track"
                                        Style="{StaticResource A_Style_FZMaterial_PlayerBar_CurrencyValueContainer}">
                                <local:FZMaterial.Preset>
                                    <local:FZMaterialPresetGlass BlurAmount="High" />
                                </local:FZMaterial.Preset>
                            </local:FZMaterial>

                            <Grid x:Name="PART_Indicator"
                                HorizontalAlignment="Left"
                                ClipToBounds="True">
                                <local:FZMaterial x:Name="ProgressIndicator"
                                                  Style="{StaticResource A_Style_FZMaterial_ProgressIndicator}"
                                                  Width="{TemplateBinding ActualWidth}" />
                                <local:FZMaterial x:Name="ProgressIndicatorGlow"
                                                  ImageSource="game:/Media/UI/Textures/Data_Bound/PDLC2/PlayerBar/Bar_Glow.png"
                                                  Stretch="Fill"
                                                  Visibility="{Binding ImageSource, ElementName=ProgressIndicator, Converter={FZBooleanToVisibilityConverter InvertResult=true}}"
                                                  Width="{TemplateBinding ActualWidth}" />
                            </Grid>
                        </Grid>
                    </DockPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:FZRun}"
           x:Key="A_Style_Run_PlayerBar_HIGHLIGHT">
        <Setter Property="Color" Value="{StaticResource A_Color_HUD_HighlightText}"/>
    </Style>

    <MappingConverter x:Key="A_MappingConverter_PlayerBar" >
        <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_Run_PlayerBar_HIGHLIGHT}" />
    </MappingConverter>

    <Style x:Key="A_Style_FZMaterial_PlayerBarCurrencyIcon" 
           TargetType="{x:Type local:FZMaterial}">
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/PlayerBar/Accolades_Icon.png" />
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Purple}" />
        <Setter Property="Width" Value="{StaticResource A_Double_Size_PlayerBar_Height}" />
        <Setter Property="Height" Value="{StaticResource A_Double_Size_PlayerBar_Height}" />
    </Style>

    <Style x:Key="A_Style_PlayerBar_Progress" TargetType="{Type FrameworkElement}">
        <Setter Property="Visibility" Value="{Binding ShowProgressBar, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding SceneEnum, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Static local:SceneEntryEnum.MapSceneCrossTrack}">
                <Setter Property="Visibility" Value="Collapsed"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Thickness x:Key="A_Margin_PlayerBarAstraReputationProgressItem">6,0</Thickness>

    <MappingConverter x:Key="A_Converter_Astra_UIRefToPlayerBarIconPath">
        <MappingConverterEntry Key="rami" Value="game:/Media/UI/Textures/Data_Bound/PDLC2/PlayerBar/rami_Level.png"/>
        <MappingConverterEntry Key="alex" Value="game:/Media/UI/Textures/Data_Bound/PDLC2/PlayerBar/alex_Level.png"/>
        <MappingConverterEntry Key="alejandra" Value="game:/Media/UI/Textures/Data_Bound/PDLC2/PlayerBar/alejandra_Level.png"/>
    </MappingConverter>

    <DataTemplate x:Key="A_Template_PlayerBarAstraReputationProgressItem">
        <DockPanel Width="160">
            <FZMaterial Style="{StaticResource A_Style_FZMaterial_PlayerBar_CurrencyContainer}"
                        Color="{StaticResource H_Color_Primary_White}"
                        DockPanel.Dock="Left">
                <Grid>
                    <FZMaterial Width="36" Height="36"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                ImageSource="{Binding UiReference, Converter={StaticResource A_Converter_Astra_UIRefToPlayerBarIconPath}}"/>
                    <FZTextBlock Text="{Binding CurrentStageIndex, Converter={StaticResource H_IndexToNumberConverter}}"
                                 FontFamily="Horizon_A"
                                 CapHeight="16"
                                 Color="{StaticResource H_Color_Primary_White}"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center"/>
                </Grid>
            </FZMaterial>
            <Grid>
                <ProgressBar x:Name="ProgressBar"
                             Style="{StaticResource A_Style_ProgressBar_CareerProgression}"
                             BlendValue.Input="{Binding CurrentProgression, Converter={StaticResource A_IntToFloatConverter}}"
                             BlendValue.ShouldSkipInitialInputChange="False"
                             BlendValue.InputChangedStoryboard="{StaticResource A_Storyboard_ProgressBar_BlendValueInputChanged_CareerProgression}"
                             Value="{Binding (local:BlendValue.Output), RelativeSource={RelativeSource Self}}"
                             Minimum="{Binding InitialProgression, Converter={StaticResource A_IntToFloatConverter}}"
                             Maximum="{Binding TotalProgression, Converter={StaticResource A_IntToFloatConverter}}"/>

                <FZTextBlock MultiStringFormatter.Format="{Binding CareerProgressionMessageFormat}"
                             MultiStringFormatter.Param0="{Binding CurrentProgression, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                             MultiStringFormatter.Param1="{Binding TotalProgression, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                             Text="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                             MarkupConverter="{StaticResource A_MappingConverter_PlayerBar}"
                             Style="{StaticResource A_Style_FZTextBlock_PlayerBar_CurrencyValueText}"
                             CapHeight="16" />
            </Grid>
        </DockPanel>
    </DataTemplate>

    <System:Int32 x:Key="H_Int32_Zero">0</System:Int32>

    <MappingConverter x:Key="H_Converter_ChallengeProgressTextColor" Default="{StaticResource H_Color_Primary_White}">
        <MappingConverterEntry Key="0" Value="{StaticResource H_Color_Primary_Purple}"/>
    </MappingConverter>


    <MappingConverter x:Key="A_Converter_SceneEnumToBackstagePassVisibility" Default="Collapsed">
        <MappingConverterEntry Key="{x:Static local:SceneEntryEnum.RareCarDealershipShop}" Value="Visible" />
    </MappingConverter>

    <ControlTemplate x:Key="A_ControlTemplate_PlayerBar" TargetType="{x:Type local:PlayerBarControl}">
        <DockPanel Margin="{StaticResource A_Thickness_Margin_PlayerBar}" >

            <!-- -->
            <!--  Stack panel right side  -->
            <!-- -->

            <StackPanel Orientation="Horizontal" local:ZPanel.SortByDepth="True"  DockPanel.Dock="Right">
                <Control DataContext="{Binding UserProfile}"  
                    Template="{StaticResource A_ControlTemplate_PlayerLevel_WithPrestige}"                             
                    Visibility="{Binding DataContext.IsWristbandVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerBarControl}}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                    Margin="0,0,15,0"/>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PlayerBar_CarInfoBackground}">
                    <StackPanel Orientation="Horizontal" Margin="15,0">
                        <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}"
                                   Color="{StaticResource H_Color_Primary_White}"
                                   Style="{StaticResource A_Style_FZTextBlock_PlayerBarBold}"/>
                        <local:PlayerAdornmentControl BadgeId="{Binding UserProfile.BadgeId}" Height="20" Width="24"/>

                        <StackPanel Orientation="Horizontal" DockPanel.Dock="Right" local:ZPanel.SortByDepth="True">
                            <StackPanel.Style>
                                <Style TargetType="{Type FrameworkElement}">
                                    <Setter Property="Visibility" Value="Collapsed"/>
                                    <Style.Triggers>
                                        <MultiDataTrigger>
                                            <MultiDataTrigger.Conditions>
                                                <Condition Binding="{Binding ShowCurrencies, RelativeSource={RelativeSource TemplatedParent}}" Value="True"/>
                                                <Condition Binding="{Binding IsCreditsIntroduced}" Value="True"/>
                                            </MultiDataTrigger.Conditions>
                                            <Setter Property="Visibility" Value="Visible"/>
                                        </MultiDataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </StackPanel.Style>
                            <FZMaterial Height="24"
                                    Width="2"
                                    Color="{StaticResource H_Color_Primary_White}" 
                                    Opacity="0.65"
                                    Margin="16,0,16,0"/>
                            <DockPanel Height="25">
                                <Control Style="{StaticResource H_Style_Control_CreditsIcon}"
                                                     DockPanel.Dock="Left" 
                                                     Margin="0,0,6,0"/>
                                <local:FZTextBlock Text="{Binding Credits, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                           Style="{StaticResource A_Style_FZTextBlock_PlayerBarBold}" 
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="Center"
                                           Color="{StaticResource H_Color_Primary_Yellow}" />
                            </DockPanel>
                        </StackPanel>
                    </StackPanel>
                </local:FZMaterial>
            </StackPanel>

            <!-- -->
            <!--  Stack panel left side  -->
            <!-- -->
            <StackPanel Orientation="Horizontal"
                        local:ZPanel.SortByDepth="True"
                        Visibility="{Binding ShowPlayerAndCarInfo, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                <!-- player -->
                <StackPanel Orientation="Horizontal" Margin="8,0"
                            Visibility="{Binding ShowCarInfo, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <!-- Car info -->
                    <Control Style="{StaticResource H_Style_TemplatedElement_CarClassBadge_White}"
                                 VerticalAlignment="Center"
                                 Height="{StaticResource A_Double_Size_PlayerBar_Height}" 
                                 local:BindingProxy.A="{Binding PerformanceIndex}"
                                 local:BindingProxy.B="{Binding ClassID}"
                                 HorizontalAlignment="Right" 
                                 Margin="0,0,14,0"/>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PlayerBar_CarInfoBackground}">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerBarBold}" 
                                       CapHeight="15"
                                       Margin="15,0"
                                       Color="{StaticResource H_Color_Primary_White}" 
                                       VerticalAlignment="Center">
                            <FZRun Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=year}"
                                               Color="{StaticResource H_Color_Primary_Yellow}" />
                            <FZRun Text=" " />
                            <FZRun Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=makename}" />
                            <FZRun Text=" " />
                            <FZRun Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=displayname}"/>
                        </local:FZTextBlock>
                    </local:FZMaterial>

                </StackPanel>
            </StackPanel>
        </DockPanel>
    </ControlTemplate>

    <Double x:Key="A_Double_Half">0.5</Double>

    <Double x:Key="H_Size_Gamerpic_BigPlayerbar">95</Double>
    <!-- Pretend the Gamerpic's material is as large as the next UserProfileGamerPictureSize threshold, as we prefer over-sampling to under-sampling, especially in 4k -->
    <Double x:Key="H_Size_Gamerpic_BigPlayerbar_Internal">208</Double>
    <CornerRadiusAlias x:Key="A_Corners_Gamerpic_BigPlayerBarx2"
        TopLeft="{StaticResource H_Size_Gamerpic_BigPlayerbar}"
        TopRight="{StaticResource H_Size_Gamerpic_BigPlayerbar}"
        BottomLeft="{StaticResource H_Size_Gamerpic_BigPlayerbar}"
        BottomRight="{StaticResource H_Size_Gamerpic_BigPlayerbar}" />
    <CornerRadiusAlias x:Key="A_Corners_Gamerpic_BigPlayerBar"
        CornerRadius="{Convert {StaticResource A_Corners_Gamerpic_BigPlayerBarx2}, Converter={MathOperationConverter Operation=Multiply}, Parameter={StaticResource A_Double_Half}, TargetType=CornerRadius}" />

    <AutoScrollSettings x:Key="A_AutoScrollSettings_BigPlayerBar_Car" 
        Speed="40"
        InitialPause="0:0:3.0"
        ScrollOrientation="Horizontal"
        ApplyClip="True"
        ScrollSeparation="50"/>
    
    <ControlTemplate x:Key="A_ControlTemplate_BigPlayerBar"
                     TargetType="{x:Type local:PlayerBarControl}">
        <Grid Height="{StaticResource A_Double_Size_BigPlayerBar}"
              Margin="0,0,0,8">
            <DockPanel>
                <FZMaterial Height="10"
                            DockPanel.Dock="Bottom"
                            Color="{StaticResource H_Color_Primary_Black}" />
                <Grid Margin="0,0,0,4">
                    <Grid VerticalAlignment="Bottom">
                        <FZMaterial x:Name="dots_helper"
                                    Visibility="Hidden"
                                    GetSizeFromTexture="True"
                                    ImageSource="Textures\Data_Bound\PlayerBar\DotsA.png"
                                    HorizontalAlignment="Left"
                                    VerticalAlignment="Top" />
                        <FZMaterial TextureWrap="True"
                                    Margin="2,0,0,0"
                                    ImageSource="Textures\Data_Bound\PlayerBar\DotsA.png"
                                    VerticalAlignment="Top"
                                    Height="{Binding ActualHeight, ElementName=dots_helper}"
                                    MultiDataConversion.Value="{Binding ActualWidth, ElementName=dots_helper}"
                                    MultiDataConversion.Parameter="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
                                    MultiDataConversion.Converter="{MathOperationConverter Operation=Divide}"
                                    MultiDataConversion.TargetType="Double">
                            <FZMaterial.ImageTransform>
                                <ScaleTransform ScaleX="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource AncestorType=FZMaterial}}" />
                            </FZMaterial.ImageTransform>
                        </FZMaterial>
                        <FZMaterial Margin="5,-6,3,0"
                                    TextureWrap="True"
                                    ImageSource="Textures\Data_Bound\PlayerBar\DotsA.png"
                                    VerticalAlignment="Top"
                                    Height="{Binding ActualHeight, ElementName=dots_helper}"
                                    MultiDataConversion.Value="{Binding ActualWidth, ElementName=dots_helper}" 
                                    MultiDataConversion.Parameter="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
                                    MultiDataConversion.Converter="{MathOperationConverter Operation=Divide}"
                                    MultiDataConversion.TargetType="Double">
                            <FZMaterial.ImageTransform>
                                <ScaleTransform ScaleX="{Binding (MultiDataConversion.Output), RelativeSource={RelativeSource AncestorType=FZMaterial}}" />
                            </FZMaterial.ImageTransform>
                        </FZMaterial>
                    </Grid>
                    <DockPanel>
                        <StackPanel Orientation="Horizontal"
                                    DockPanel.Dock="Right"
                                    Margin="0,0,0,26"
                                    VerticalAlignment="Bottom"
                                    local:ZPanel.SortByDepth="True"
                                    Visibility="{Binding ShowPlayerAndCarInfo, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <!-- player -->
                            <StackPanel Orientation="Horizontal">
                                <!-- GAMERPIC -->
                                <Grid Height="{StaticResource H_Size_Gamerpic_BigPlayerbar}"
                                      Width="{StaticResource H_Size_Gamerpic_BigPlayerbar}"                      
                                      Margin="0,0,16,0">
                                    <FZMaterial Margin="0,0,-8,-8" Color="{StaticResource A_Color_DropShadow}" Opacity="1.0" IsHitTestVisible="False">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangle x:Name="Shadow"
                                                                         Softness="10"
                                                                         CornerRadius="1"/>
                                        </FZMaterial.Preset>
                                    </FZMaterial>
                                    <local:FZMaterial Stretch="UniformToFill"
                                                      ImageSource="{Binding UserProfile, Converter={StaticResource A_GamerPicConverter}, ConverterParameter={StaticResource H_Size_Gamerpic_BigPlayerbar_Internal}}"/>
                                </Grid>
                                <StackPanel Orientation="Vertical" VerticalAlignment="Center" Margin="0,0,20,0">
                                    <Control DataContext="{Binding UserProfile}"  
                                             Template="{StaticResource A_ControlTemplate_PlayerLevel_WithPrestige}" 
                                             Margin="0,0,0,5"
                                             Visibility="{Binding DataContext.IsWristbandVisible, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerBarControl}}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                                    <!-- Gamertag -->
                                    <StackPanel Orientation="Horizontal" Margin="0,0,0,6" Height="25">
                                        <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}"
                                                 Color="{StaticResource H_Color_Primary_White}"
                                                 CapHeight="21"
                                                 Style="{StaticResource A_Style_FZTextBlock_PlayerBarBold}" />
                                        <local:PlayerAdornmentControl BadgeId="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                    <!--currencies -->
                                    <StackPanel Orientation="Horizontal" 
                                                VerticalAlignment="Bottom" 
                                                local:ZPanel.SortByDepth="True" 
                                                Tag="{Binding ShowCurrencies,  RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                        <DockPanel Height="25"           
                                                   Visibility="{Binding IsCreditsIntroduced, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                            <Control Style="{StaticResource H_Style_Control_CreditsIcon}"  
                                                     DockPanel.Dock="Left" 
                                                     Margin="0,0,6,0"/>
                                            <local:FZTextBlock Text="{Binding Credits, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"             
                                                      VerticalAlignment="Center"
                                                      HorizontalAlignment="Center"
                                                      CapHeight="18"
                                                      FontFamily="Horizon_C"
                                                      Color="{StaticResource H_Color_Primary_Yellow}" />
                                        </DockPanel>
                                    </StackPanel>
                                </StackPanel>
                            </StackPanel>
                        </StackPanel>

                        <DockPanel HorizontalAlignment="Left"
                                    local:ZPanel.SortByDepth="True"
                                    Visibility="{Binding ShowCarInfo, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">

                            <!-- Car info -->
                            <FZMaterial ImageSource="{Binding CarThumbnail}"
                                        GreedyMeasure="True"
                                        Stretch="Uniform" VerticalAlignment="Bottom"
                                        DockPanel.Dock="Left" >
                            </FZMaterial>
                            <StackPanel Orientation="Vertical"
                                        VerticalAlignment="Bottom"
                                        Margin="0,0,0,26">
                                <Control Style="{StaticResource H_Style_TemplatedElement_CarClassBadge_White}"
                                                 local:BindingProxy.A="{Binding PerformanceIndex}"
                                                 Height="34"
                                                 HorizontalAlignment="Left"
                                                 VerticalAlignment="Center"
                                                 Margin="0,0,0,8"
                                                 local:BindingProxy.B="{Binding ClassID}" />
                                <DockPanel HorizontalAlignment="Left">
                                    <Decorator Width="13"
                                               DockPanel.Dock="Right" />
                                    <local:FZTextBlock FontFamily="Horizon_C"
                                                       CapHeight="18"
                                                       Color="{StaticResource H_Color_Primary_White}">
                                        <FZRun Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=year}"
                                               Color="{StaticResource H_Color_Primary_Yellow}" />
                                        <FZRun Text=" " />
                                        <FZRun Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=makename}" />
                                    </local:FZTextBlock>
                                </DockPanel>
                                <local:FZTextBlock Text="{Binding CarId, Converter={CarOrdinalConverter}, ConverterParameter=displayname}"
                                                   FontFamily="Horizon_C"
                                                   CapHeight="21"
                                                   Stretch="None"
                                                   Color="{StaticResource H_Color_Primary_White}"
                                                   AutoScroll="{StaticResource A_AutoScrollSettings_BigPlayerBar_Car}"
                                                   Margin="0,8,8,0"/>
                            </StackPanel>
                        </DockPanel>

                    </DockPanel>
                </Grid>
            </DockPanel>
        </Grid>
    </ControlTemplate>

    <Storyboard x:Key="ShowControllerButtonPanel">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="ShowControllerButtonPanelInstant">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <LinearDoubleKeyFrame KeyTime="0" Value="1"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <Storyboard x:Key="HideControllerButtonPanel">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>
    <Storyboard x:Key="HideControllerButtonPanelInstant">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
            <LinearDoubleKeyFrame KeyTime="0" Value="0"/>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <ControlTemplate x:Key="A_ControlTemplate_ButtonBar" TargetType="ContentControl">
        <Grid RenderTransformOrigin="0.5,1.0"
              VerticalAlignment="Bottom"
              Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Grid Margin="{StaticResource A_Thickness_Margin_ButtonBar}"
                  VerticalAlignment="Bottom"
                  HorizontalAlignment="Left">
                <Viewbox StretchDirection="DownOnly">
                    <local:FZMaterial x:Name="ControllerStyleBackground"
                                      Style="{StaticResource A_Style_ControllerButton_Background}"
                                      Height="45"
                                      Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_ControllerButtonBackground}">
                        <ContentPresenter x:Name="ControllerButtonPanel"
                                              Margin="10,0,-10,0"
                                              VerticalAlignment="Center" />
                    </local:FZMaterial>
                </Viewbox>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding IsControllerActiveInput, RelativeSource={RelativeSource AncestorType=Page}, FallbackValue=True}"
                         Value="False">
                <Setter TargetName="ControllerStyleBackground"
                        Property="Color"
                        Value="#00000000" />
                <Setter TargetName="ControllerStyleBackground"
                        Property="Preset"
                        Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_ConsoleButtonBarBackground_All }" />
                <Setter TargetName="ControllerButtonPanel"
                        Property="Margin"
                        Value="0" />
            </DataTrigger>
            <DataTrigger Binding="{Binding ActualWidth, ElementName=ControllerButtonPanel}"
                         Value="0">
                <Setter TargetName="ControllerButtonPanel"
                        Property="Margin"
                        Value="0" />
            </DataTrigger>
            <EventTrigger RoutedEvent="ControllerButtonPanel.ShowControllerButtonPanel">
                <local:BeginUIStoryboard Storyboard="{StaticResource ShowControllerButtonPanel}"/>
            </EventTrigger>
            <EventTrigger RoutedEvent="ControllerButtonPanel.ShowControllerButtonPanelInstant">
                <local:BeginUIStoryboard Storyboard="{StaticResource ShowControllerButtonPanelInstant}"/>
            </EventTrigger>
            <EventTrigger RoutedEvent="ControllerButtonPanel.HideControllerButtonPanel">
                <local:BeginUIStoryboard Storyboard="{StaticResource HideControllerButtonPanel}"/>
            </EventTrigger>
            <EventTrigger RoutedEvent="ControllerButtonPanel.HideControllerButtonPanelInstant">
                <local:BeginUIStoryboard Storyboard="{StaticResource HideControllerButtonPanelInstant}"/>
            </EventTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_PlayerBarControl"
           BasedOn="{StaticResource A_Style_FrameworkElement_LayoutRoot}"
           TargetType="{x:Type local:PlayerBarControl}">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_PlayerBar}" />
        <Setter Property="Focusable" Value="False" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="local:BindingProxy.A" Value="is_not_in_map" />
        <Setter Property="RenderTransformOrigin"
                Value="0.5,0.0" />
        <Setter Property="Height"
                Value="auto" />
        <Setter Property="DataContext"
                Value="{StaticResource PART_UIPlayerData}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding InSplash, Source={StaticResource PART_UISceneContext}}" Value="True">
                <Setter Property="Visibility" Value="Collapsed" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_PlayerBarControl_WithTokens" TargetType="local:PlayerBarControl" BasedOn="{StaticResource A_Style_PlayerBarControl}">
        <Setter Property="ShowTokens" Value="True" />
    </Style>

    <Style x:Key="A_Style_ButtonBar" TargetType="ContentControl">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_ButtonBar}" />
        <Setter Property="Focusable" Value="False" />
    </Style>

</ResourceDictionary>