<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">

    <local:StringVisConverter x:Key="A_Converter_StringToVis" />
    <BooleanToVisibilityConverter x:Key="BoolVisConverter" />
    <Double x:Key="A_Double_XPBackground_CarLabel_Opacity">0.6</Double>

    <!-- copied from Shared_PlayerLevel, opacity of the material needs to be different on the labels and the XP material should not have a margin around it -->
    <local:FZMaterialPresetRoundtangle CornerRadius="1,0,0,1"
                                       x:Key="A_FZMaterialPreset_PlayerLevel_CarLabel_Panel" />

    <ControlTemplate x:Key="A_ControlTemplate_PlayerLevel_CarLabel_Base"
                    TargetType="Control">
            <Grid>
                <local:FZMaterial Color="{StaticResource H_Color_Primary_White}"
                                Preset="{StaticResource H_Roundtangle_Outer_1px}"
                                Opacity="{StaticResource A_Double_XPBackground_CarLabel_Opacity}">
                    <local:FZMaterial Color="{Binding UserProfile.XP, Converter={StaticResource A_XPConverter}}"
                                    GreedyMeasure="True"
                                    Preset="{StaticResource A_FZMaterialPreset_PlayerLevel_CarLabel_Panel}"/>
                </local:FZMaterial>
                <Viewbox Stretch="Uniform"
                        StretchDirection="Both">
                    <Grid MaxWidth="58"
                        Height="40">
                        <local:FZTextBlock Style="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                        CapHeight="20"
                                        Margin="4" />
                    </Grid>
                </Viewbox>
            </Grid>
    </ControlTemplate>
    
    <!-- copied from Shared_PlayerLevel, opacity of the material needs to be different on the labels -->
    <ControlTemplate x:Key="A_ControlTemplate_PlayerLevel_CarLabel_Tier1"
                    TargetType="Control">
            <Grid>
                <local:FZMaterial Color="{StaticResource H_Color_Primary_White}"
                                Preset="{StaticResource H_Roundtangle_Outer_1px}"
                                Opacity="{StaticResource A_Double_XPBackground_CarLabel_Opacity}">
                        <local:FZMaterial Color="{Binding UserProfile.XP, Converter={StaticResource A_XPConverter}}"
                                        GreedyMeasure="True"
                                        Preset="{StaticResource A_FZMaterialPreset_PlayerLevel_CarLabel_Panel}"/>
                </local:FZMaterial> 
                <Viewbox Stretch="Uniform"
                        StretchDirection="Both">
                    <Grid Width="40"
                        Height="40">
                        <local:FZTextBlock Style="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                        CapHeight="20"
                                        Margin="4" />
                    </Grid>
                </Viewbox>
            </Grid>
    </ControlTemplate>

    <!-- copied from Shared_PlayerLevel, opacity of the material needs to be different on the labels -->
    <ControlTemplate x:Key="A_ControlTemplate_PlayerLevel_CarLabel_HighTier"
                 TargetType="Control">
        <Grid>
            <local:FZMaterial ImageSource="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                              GreedyMeasure="True"
                              Preset="{StaticResource A_FZMaterialPreset_PlayerLevel_CarLabel_Panel}"
                              Opacity="0.9" />
            <Viewbox Stretch="Uniform"
                     StretchDirection="Both">
                <Grid MaxWidth="58"
                      Height="40">
                    <local:FZTextBlock Style="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                        CapHeight="20"
                                       Margin="4" />
                </Grid>
            </Viewbox>
        </Grid>
    </ControlTemplate>

    <System:Double x:Key="A_Double_LeftAndRightBox_CarLabel_Width">142</System:Double>

    <Style x:Key="A_Style_FZTextBlock_PlayerLevelTextCarLabel_Base"
           TargetType="{x:Type local:FZTextBlock}"
           BasedOn="{StaticResource A_Style_FZTextBlock_PlayerLevelText_Base}">
        <Setter Property="Text"
                Value="{Binding UserProfile.XP, Converter={StaticResource A_XPConverter_LevelText}}" />
        <Setter Property="Color"
                Value="{Binding UserProfile.XP, Converter={StaticResource A_XPConverter_Text}}" />
    </Style>

    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Base"
        TargetType="Control">
        <Setter Property="Visibility"
                Value="{Binding IsXPIntroduced, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
        <Setter Property="Template"
                Value="{StaticResource A_ControlTemplate_PlayerLevel_CarLabel_Base}" />
        <Setter Property="local:BindingProxy.A"
                Value="{StaticResource A_Style_FZTextBlock_PlayerLevelTextCarLabel_Base}" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="Width" 
                Value="{StaticResource A_Double_LeftAndRightBox_CarLabel_Width}" />
    </Style>
    
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier1"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        <Setter Property="Template"
                Value="{StaticResource A_ControlTemplate_PlayerLevel_CarLabel_Tier1}" />
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier2"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier3"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier4"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier5"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier6"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier7"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier8"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier9"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier10"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        <Setter Property="Template"
                Value="{StaticResource A_ControlTemplate_PlayerLevel_CarLabel_HighTier}" />
        <Setter Property="local:BindingProxy.B"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PlayerLevel/bronze.png" />
        <Setter Property="local:BindingProxy.C"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PlayerLevel/BronzeShine.png" />
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier11"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        <Setter Property="Template"
                Value="{StaticResource A_ControlTemplate_PlayerLevel_CarLabel_HighTier}" />
        <Setter Property="local:BindingProxy.B"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PlayerLevel/silver.png" />
        <Setter Property="local:BindingProxy.C"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PlayerLevel/EverythingShine.png" />
    </Style>
    <Style x:Key="A_Style_Control_PlayerLevel_CarLabel_Tier12"
        TargetType="Control"
        BasedOn="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Base}">
        <Setter Property="Template"
                Value="{StaticResource A_ControlTemplate_PlayerLevel_CarLabel_HighTier}" />
        <Setter Property="local:BindingProxy.B"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PlayerLevel/Player_Bar_Gold_Short.png" />
    </Style>

    <local:MappingConverter x:Key="A_Converter_XPTierToControlStyle_OpponentLabel">
        <local:MappingConverterEntry Key="Tier1" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier1}"/>
        <local:MappingConverterEntry Key="Tier2" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier2}"/>
        <local:MappingConverterEntry Key="Tier3" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier3}"/>
        <local:MappingConverterEntry Key="Tier4" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier4}"/>
        <local:MappingConverterEntry Key="Tier5" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier5}"/>
        <local:MappingConverterEntry Key="Tier6" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier6}"/>
        <local:MappingConverterEntry Key="Tier7" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier7}"/>
        <local:MappingConverterEntry Key="Tier8" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier8}"/>
        <local:MappingConverterEntry Key="Tier9" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier9}"/>
        <local:MappingConverterEntry Key="Tier10" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier10}"/>
        <local:MappingConverterEntry Key="Tier11" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier11}"/>
        <local:MappingConverterEntry Key="Tier12" Value="{StaticResource A_Style_Control_PlayerLevel_CarLabel_Tier12}"/>
    </local:MappingConverter>

    <local:WristbandConverter x:Key="A_WristbandConverter_OpponentLabel"
                    ColorConverter="{StaticResource A_Converter_XPTierToGradientColorA}"
                    StyleConverter="{StaticResource A_Converter_XPTierToControlStyle_OpponentLabel}" />

    <local:XPConverter x:Key="A_XPConverter_OpponentLabel"
                    ColorConverter="{StaticResource A_Converter_XPTierToGradientColorA}"
                    StyleConverter="{StaticResource A_Converter_XPTierToControlStyle_OpponentLabel}" />
    <!-- end of copied code from Shared_PlayerLevel -->

    <ColorAlias x:Key="A_Color_CarLabel_Friend" Color="{StaticResource H_Color_Primary_LightBlue}" />

    <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlass_LightweightCarLabelBackground_Base"
                               CornerRadius="1"
                               BlurAmount="Low"
                               GlassColor="#FFFFFFFF" />

    <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlass_CarLabelBackground"
                               BasedOn="{StaticResource A_FZMaterialPresetGlass_LightweightCarLabelBackground_Base}"
                               BlurAmount="Medium" />

    <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlass_LightweightCarLabelBackground_WithoutDepthTest" BasedOn="{StaticResource A_FZMaterialPresetGlass_LightweightCarLabelBackground_Base}"
                               DepthTest="False"
                               CornerRadius="8" />

    <Style x:Key="A_Style_Decorator_DebugCarLabelDescription" TargetType="{Type Decorator}">
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Margin" Value="0,0,0,-350" />
        <Setter Property="Visibility" Value="{Binding DebugLabelDescription, Converter={StaticResource A_Converter_StringToVis}}" />
        <Setter Property="LayoutTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="{Binding Path=ScaleValue, Source={StaticResource PART_UIResolutionScaler}}"
                                ScaleY="{Binding Path=ScaleValue, Source={StaticResource PART_UIResolutionScaler}}" />
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_CarLabel_OpponentTag"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="Color"
                Value="{StaticResource A_Color_TileSelected_Text}" />
        <Setter Property="CapHeight"
                Value="61" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="TrackingAdjust" Value="0.01" />
    </Style>

    <Style x:Key="A_Style_CarLabel_QuickChat"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="Color"
                Value="#ff353535" />
        <Setter Property="Margin"
                Value="60,30,60,0" />
        <Setter Property="CapHeight"
                Value="58" />
        <Setter Property="VerticalAlignment"
                Value="Top" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
    </Style>

    <Style x:Key="A_Style_CarLabel_StatusText"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonF}">
        <Setter Property="Color"
                Value="#ff353535" />
        <Setter Property="Margin"
                Value="60,0" />
        <Setter Property="CapHeight"
                Value="58" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="Effect"
                Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
    </Style>

    <Style x:Key="A_Style_CarLabel_LabelText"
           TargetType="local:FZTextBlock"
           BasedOn="{StaticResource A_Style_FZTextBlock_HorizonC}">
        <Setter Property="Color"
                Value="#6d6e70" />
        <Setter Property="CapHeight"
                Value="70" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="Text"
                Value="{Binding OpponentPlace}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.TeamRace}">
                <Setter Property="Color"
                        Value="#FFFFFFFF" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_MappingConverter_OpponentLabel_PlaygroundGames_StateColor">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.None}" Value="#66FFFFFF" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Infected}" Value="{StaticResource A_Color_List_Infected_Background}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Contaminated}" Value="{StaticResource A_Color_List_Contaminated_Background}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Survivor}" Value="{StaticResource A_Color_List_Survivor_Background}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.King}" Value="{StaticResource A_Color_List_King_Background}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag0}" Value="{StaticResource A_Color_FlagRush_Flag0}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag1}" Value="{StaticResource A_Color_FlagRush_Flag1}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag2}" Value="{StaticResource A_Color_FlagRush_Flag2}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag3}" Value="{StaticResource A_Color_FlagRush_Flag3}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag4}" Value="{StaticResource A_Color_FlagRush_Flag4}" />
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_MappingConverter_OpponentLabel_PlaygroundGames_TeamFlagRushState_TeamA">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag0}" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag1}" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag2}" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag3}" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag4}" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_MappingConverter_OpponentLabel_PlaygroundGames_TeamFlagRushState_TeamB">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag0}" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag1}" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag2}" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag3}" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag4}" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_MappingConverter_OpponentLabel_PlaygroundGames_StateIcon">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.None}" Value="" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Infected}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Zombie_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Contaminated}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Infected_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Survivor}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Survivor_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.King}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/King_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag0}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Flag_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag1}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Flag_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag2}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Flag_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag3}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Flag_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Flag4}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Flag_DriverLabel.png" />
    </local:MappingConverter>

    <Style x:Key="A_Style_CarLabel_Trim"
           TargetType="local:FZMaterial">
        <Setter Property="Color"
                Value="{Binding CarLabelTagState, Converter={StaticResource A_MappingConverter_OpponentLabel_PlaygroundGames_StateColor}}" />
        <Style.Triggers>
            <!-- Red Team -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamFlagRush}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                               Value="{x:Static local:CarLabelTagState.BurdenedKing}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_BurdenedKingBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamRace}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
            </MultiDataTrigger>

            <!-- Blue Team -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamFlagRush}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamRace}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                               Value="{x:Static local:CarLabelTagState.BurdenedKing}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_BurdenedKingBackground}" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_CarLabel_LeftBox"
           TargetType="local:FZMaterial">
        <Setter Property="Color" Value="{Binding CarLabelTagState, Converter={StaticResource A_MappingConverter_OpponentLabel_PlaygroundGames_StateColor}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" 
                         Value="{x:Static local:CarLabelSessionMode.Freeroam}">
                <Setter Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" 
                         Value="{x:Static local:CarLabelSessionMode.Race}">
                <Setter Property="Color"
                        Value="#FFFFFFFF" />
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" 
                         Value="{x:Static local:CarLabelSessionMode.MultiplayerBuilding}">
                <Setter Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>
            <!-- Red Team -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamRace}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <!-- Blue Team -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamRace}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <!-- Red Team Flag Rush -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamFlagRush}" />
                    <Condition Binding="{Binding Team}"
                               Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{Binding CarLabelTagState, Converter={StaticResource A_MappingConverter_OpponentLabel_PlaygroundGames_TeamFlagRushState_TeamA}}" />
            </MultiDataTrigger>
            <!-- Blue Team Flag Rush -->
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                               Value="{x:Static local:CarLabelSessionMode.TeamFlagRush}" />
                    <Condition Binding="{Binding Team}"
                               Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{Binding CarLabelTagState, Converter={StaticResource A_MappingConverter_OpponentLabel_PlaygroundGames_TeamFlagRushState_TeamB}}" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_Converter_CollapseWhenMinusOne" Default="Visible">
        <local:MappingConverterEntry Key="-1" Value="Collapsed"/>
    </local:MappingConverter>

    <ControlTemplate x:Key="A_ControlTemplate_CarLabel_LeftBox"
                     TargetType="{x:Type Control}">
        <Grid x:Name="Container">
            <Decorator x:Name="XP"
                Visibility="Collapsed" >
                <Control Style="{Binding UserProfile.XP, Converter={StaticResource A_XPConverter_OpponentLabel}}" />
            </Decorator>
            <local:FZMaterial Style="{StaticResource A_Style_CarLabel_LeftBox}" x:Name="Background" Margin="0,0,-0.5,0"
                Width="{StaticResource A_Double_LeftAndRightBox_CarLabel_Width}">
                <local:FZMaterial.Preset>
                    <local:FZMaterialPresetGlassRoundtangle BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}"
                                                            CornerRadius="1,0,0,1"
                                                            GlassColor="#E1FFFFFF"/>
                </local:FZMaterial.Preset>
                <Grid>
                    <local:FZTextBlock x:Name="Text"
                                       Style="{StaticResource A_Style_CarLabel_LabelText}"
                                       Visibility="Collapsed"/>
                    <local:FZMaterial x:Name="Icon"
                                      Stretch="Uniform"
                                      Margin="0,-6,-1,-6"
                                      ImageSource="{Binding CarLabelTagState, Converter={StaticResource A_MappingConverter_OpponentLabel_PlaygroundGames_StateIcon}}" />
                </Grid>
            </local:FZMaterial>
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.King}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.None}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.None}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.FlagRush}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.None}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamFlagRush}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.None}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.King}" />
                    <Condition Binding="{Binding Team}"
                                Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="Background"
                        Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.King}" />
                    <Condition Binding="{Binding Team}"
                                Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="Background"
                        Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
            </MultiDataTrigger>
            
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.BurdenedKing}" />
                    <Condition Binding="{Binding Team}"
                                Value="0" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="Background"
                        Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_A_BurdenedKingBackground}" />
                <Setter TargetName="Icon"
                        Property="ImageSource"
                        Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/BurdenedKing_DriverLabel.png" />
                <Setter TargetName="Icon"
                        Property="Margin"
                        Value="-16,-17" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}"
                                Value="{x:Static local:CarLabelSessionMode.TeamKing}" />
                    <Condition Binding="{Binding CarLabelTagState}"
                                Value="{x:Static local:CarLabelTagState.BurdenedKing}" />
                    <Condition Binding="{Binding Team}"
                                Value="1" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="Background"
                        Property="Color"
                        Value="{StaticResource A_Color_HUD_Team_B_BurdenedKingBackground}" />
                <Setter TargetName="Icon"
                        Property="ImageSource"
                        Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/BurdenedKing_DriverLabel.png" />
                <Setter TargetName="Icon"
                        Property="Margin"
                        Value="-16,-17" />
            </MultiDataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Eliminator}">
                <Setter Property="Visibility"
                        Value="Collapsed"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Freeroam}">
                <Setter TargetName="XP"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="Icon"
                        Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Race}">
                <Setter TargetName="Icon"
                        Property="Visibility"
                        Value="Collapsed" />
                <Setter TargetName="Text"
                        Property="Visibility"
                        Value="Visible" />
                <Setter Property="Visibility"
                        Value="{Binding OpponentPlace, Converter={StaticResource A_Converter_CollapseWhenMinusOne}, FallbackValue=Collapsed}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.TeamRace}">
                <Setter TargetName="Icon"
                        Property="Visibility"
                        Value="Collapsed" />
                <Setter TargetName="Text"
                        Property="Visibility"
                        Value="Visible" />
                <Setter Property="Visibility"
                        Value="{Binding OpponentPlace, Converter={StaticResource A_Converter_CollapseWhenMinusOne}, FallbackValue=Collapsed}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.MultiplayerBuilding}">
                <Setter TargetName="XP"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="Icon"
                        Property="Visibility"
                        Value="Collapsed" />
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <BitmapImage x:Key="A_ImageSource_CarLabel_Glow"
                 UriSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Rivals/ElipseGlow.png" />

    <Style x:Key="A_Style_FZMaterial_CarLabel_Convoy_Icon" TargetType="local:FZMaterial">
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/ConvoyIcon.png"/>
        <Setter Property="Visibility" Value="Collapsed"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsLeader}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Convoy_Leader.png"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_CarLabel_Friend_Icon" TargetType="local:FZMaterial">
        <Setter Property="Visibility" Value="Collapsed" />
        <Setter Property="Color" Value="{StaticResource A_Color_CarLabel_Friend}" />
        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Friend.png" />
    </Style>

    <Color x:Key="A_Color_DriverLabel_Convoy">#FF0BD85E</Color>

    <Storyboard x:Key="A_Storyboard_RightBoxFlash">
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="Glow"
                                   Storyboard.TargetProperty="Opacity">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                Value="0.0" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.1"
                              EasingFunction="{local:QuadraticEasing}"
                              Value="0.6" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.6"
                              EasingFunction="{local:QuadraticEasing}"
                              Value="0" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="GlowScale"
                                   Storyboard.TargetProperty="ScaleX">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                Value="2" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                              EasingFunction="{local:LinearEasing}"
                              Value="6" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetName="GlowScale"
                                   Storyboard.TargetProperty="ScaleY">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                Value="2" />
            <EasingDoubleKeyFrame KeyTime="0:0:0.5"
                              EasingFunction="{local:LinearEasing}"
                              Value="6" />
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <ControlTemplate x:Key="A_ControlTemplate_CarLabel_RightBox"
                     TargetType="{x:Type Control}">
        <Grid Width="{StaticResource A_Double_LeftAndRightBox_CarLabel_Width}"
              Margin="-0.5,0,0,0"
              Visibility="Collapsed"
              x:Name="Container">
            <local:FZMaterial Color="#4d000000"
                              Style="{StaticResource A_Style_FZMaterial_GlassPanel_NonInteractive}"
                              x:Name="Background">
                    <local:FZMaterial.Preset>
                        <local:FZMaterialPresetGlassRoundtangle BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}"
                                                                CornerRadius="0,1,1,0" />
                    </local:FZMaterial.Preset><!--bam-->
                <Grid>
                    <local:FZMaterial x:Name="ConvoyIcon" Style="{StaticResource A_Style_FZMaterial_CarLabel_Convoy_Icon}"
                                    Stretch="Uniform"
                                    Color="#ffffff">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle CornerRadius="0,1,1,0" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="FriendIcon" Style="{StaticResource A_Style_FZMaterial_CarLabel_Friend_Icon}"
                                    Stretch="Uniform">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle CornerRadius="0,1,1,0" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="LINKSkillIcon" Style="{StaticResource A_Style_FZMaterial_CarLabel_LinkSkillIcon}"
                                      Stretch="Uniform" Margin="0,16">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle CornerRadius="0,1,1,0" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
            </local:FZMaterial>

            <local:FZMaterial x:Name="Glow"
                              ImageSource="{StaticResource A_ImageSource_CarLabel_Glow}"
                              Preset="{StaticResource A_FZMaterialPresetAdditive}"
                              GreedyMeasure="True"
                              RenderTransformOrigin="0.5,0.5"
                              Opacity="0">
                <local:FZMaterial.RenderTransform>
                    <ScaleTransform x:Name="GlowScale"
                                    ScaleX="1"
                                    ScaleY="1" />
                </local:FZMaterial.RenderTransform>
            </local:FZMaterial>
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsFriend}" Value="False" />
                    <Condition Binding="{Binding IsInConvoy}" Value="False" />
                    <Condition Binding="{Binding LinkSkillGrade, Converter={StaticResource H_TrueIfNull}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Freeroam}" />
                    <Condition Binding="{Binding IsFriend}" Value="True" />
                    <Condition Binding="{Binding IsInConvoy}" Value="False" />
                    <Condition Binding="{Binding LinkSkillGrade, Converter={StaticResource H_TrueIfNull}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="FriendIcon" Property="Visibility" Value="Visible" />
            </MultiDataTrigger>

            <DataTrigger Binding="{Binding CarLabelSessionMode}"
                         Value="{x:Static local:CarLabelSessionMode.Freeroam}">
                <Setter TargetName="Container"
                        Property="Visibility"
                        Value="Visible" />
            </DataTrigger>
            <MultiDataTrigger>
                 <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsInConvoy}" Value="True"/>
                    <Condition Binding="{Binding LinkSkillGrade, Converter={StaticResource H_TrueIfNull}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter TargetName="ConvoyIcon"
                        Property="Visibility"
                        Value="Visible" />
                <Setter TargetName="ConvoyIcon"
                        Property="Color"
                        Value="{StaticResource A_Color_DriverLabel_Convoy}" />
                <MultiDataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_RightBoxFlash}"/>
                </MultiDataTrigger.EnterActions>
            </MultiDataTrigger>
            <DataTrigger Binding="{Binding IsFriend}"
                         Value="True">
                <Setter TargetName="ConvoyIcon"
                        Property="Color"
                        Value="{StaticResource A_Color_CarLabel_Friend}" />
            </DataTrigger>

            <DataTrigger Binding="{Binding LinkSkillGrade, Converter={StaticResource H_TrueIfNotNull}}" 
                        Value="{StaticResource A_Boolean_True}">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_RightBoxFlash}"/>
                </DataTrigger.EnterActions>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <local:MappingConverter x:Key="A_Converter_CarLableSessionModeToPromoIconVisible"
                            Default="{StaticResource A_Boolean_False}" CheckEnumKey="CarLabelSessionMode">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.Freeroam}" Value="{StaticResource A_Boolean_True}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.Race}" Value="{StaticResource A_Boolean_True}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.TeamRace}" Value="{StaticResource A_Boolean_True}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.Rivals}" Value="{StaticResource A_Boolean_True}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.Infected}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.King}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.FlagRush}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.TeamInfected}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.TeamKing}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.TeamFlagRush}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.Eliminator}" Value="{StaticResource A_Boolean_False}" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelSessionMode.MultiplayerBuilding}" Value="{StaticResource A_Boolean_False}" />
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_CarLabelTagStateToMultiplayerBuildingIcon" Default="">
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.Building}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/MultiplayerBuilding/Building_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.CreatingChallenge}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/MultiplayerBuilding/CreatingChallenge_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.RouteCreator}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/MultiplayerBuilding/RouteCreator_DriverLabel.png" />
        <local:MappingConverterEntry Key="{x:Static local:CarLabelTagState.TestDrive}" Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/MultiplayerBuilding/TestDrive_DriverLabel.png" />
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_CarLabel_PhotoNeededIcon"
           TargetType="local:FZMaterial">
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode, Converter={StaticResource A_Converter_CarLableSessionModeToPromoIconVisible}}" 
                               Value="{StaticResource A_Boolean_True}" />
                    <Condition Binding="{Binding IsPhotoNeeded}"
                               Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility"
                        Value="Visible" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_CarLabel_MultiplayerBuildingIcon"
           TargetType="local:FZMaterial">
        <Setter Property="Visibility" Value="Collapsed" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.MultiplayerBuilding}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Visible" />
                <Setter Property="ImageSource" Value="{Binding CarLabelTagState, Converter={StaticResource A_Converter_CarLabelTagStateToMultiplayerBuildingIcon}}" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_Converter_HeadToHeadState_To_Icon" Default="{x:Null}">
        <local:MappingConverterEntry Key="{x:Static local:HeadToHeadState.IsCurrentOpponent}"
                                     Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/HUD_Label/H2H_Target.png" />
        <local:MappingConverterEntry Key="{x:Static local:HeadToHeadState.Unavailable}"
                                     Value="/ForzaUI;component/Textures/Data_Bound/Eliminator/HUD_Label/H2H_Unavailable.png" />
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_IsHeadToHeadStateUseAnIcon" Default="{StaticResource A_Boolean_False}">
        <local:MappingConverterEntry Key="{x:Static local:HeadToHeadState.IsCurrentOpponent}"
                                     Value="{StaticResource A_Boolean_True}" />
        <local:MappingConverterEntry Key="{x:Static local:HeadToHeadState.Unavailable}"
                                     Value="{StaticResource A_Boolean_True}" />
    </local:MappingConverter>
    
    <Style x:Key="A_Style_FZMaterial_CarLabel_H2HIcon"
           TargetType="local:FZMaterial">
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}" 
                               Value="{x:Static local:CarLabelSessionMode.Eliminator}" />
                    <!-- In an active head to head -->
                    <Condition Binding="{Binding HeadToHeadState, Converter={StaticResource A_Converter_IsHeadToHeadStateUseAnIcon}}" 
                               Value="{StaticResource A_Boolean_True}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="ImageSource" 
                        Value="{Binding HeadToHeadState, Converter={StaticResource A_Converter_HeadToHeadState_To_Icon}}"/>
                <Setter Property="Visibility" 
                        Value="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_CarLabel_LinkSkillIcon"
       TargetType="local:FZMaterial">
        <Setter Property="Visibility"
                Value="Collapsed" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding LinkSkillGrade, Converter={StaticResource H_TrueIfNotNull}}" 
                               Value="{StaticResource A_Boolean_True}" />
                </MultiDataTrigger.Conditions>
                <Setter Property="ImageSource" 
                        Value="/ForzaUI;component/Textures/Anthem/HUD/LINKSkills/LINK_Skill_PlayerLabel_Icon.png"/>
                <Setter Property="Visibility" 
                        Value="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Thickness x:Key="A_Thickness_CarLabel_Trim">7</Thickness>
    <CornerRadius x:Key="A_CornerRadius_CarLabel_Trim">8</CornerRadius>

    <ControlTemplate TargetType="Control"
                     x:Key="A_Template_Control_CarLabelTrim">
        <Grid>
            <DockPanel Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid DockPanel.Dock="Right"
                      Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                    <Grid.LayoutTransform>
                        <ScaleTransform x:Name="LeftScale"
                                        ScaleX="0" />
                    </Grid.LayoutTransform>
                </Grid>
                <Grid ClipToBounds="True">
                    <local:FZMaterial Style="{StaticResource A_Style_CarLabel_Trim}"
                                      HorizontalAlignment="Left"
                                      Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetGlassRoundtangleStroke
                                Thickness="{StaticResource A_Thickness_CarLabel_Trim}"
                                CornerRadius="{StaticResource A_CornerRadius_CarLabel_Trim}" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
            </DockPanel>
            <DockPanel Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                <Grid DockPanel.Dock="Left"
                      Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                    <Grid.LayoutTransform>
                        <ScaleTransform x:Name="RightScale"
                                        ScaleX="1" />
                    </Grid.LayoutTransform>
                </Grid>
                <Grid ClipToBounds="True">
                    <local:FZMaterial Color="{StaticResource A_Color_DriverLabel_Convoy}"
                                      HorizontalAlignment="Right"
                                      Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangleStroke Thickness="5"
                                                                     CornerRadius="8" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
            </DockPanel>
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsInConvoy}" Value="True"/>
                    <Condition Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Freeroam}"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.EnterActions>
                    <BeginStoryboard x:Name="NowInConvoy">
                        <Storyboard>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="LeftScale"
                                                           Storyboard.TargetProperty="ScaleX">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                                      Value="1" />
                            </DoubleAnimationUsingKeyFrames>
                            <DoubleAnimationUsingKeyFrames Storyboard.TargetName="RightScale"
                                                           Storyboard.TargetProperty="ScaleX">
                                <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                                      Value="0" />
                            </DoubleAnimationUsingKeyFrames>
                        </Storyboard>
                    </BeginStoryboard>
                </MultiDataTrigger.EnterActions>
                <MultiDataTrigger.ExitActions>
                    <StopStoryboard BeginStoryboardName="NowInConvoy"/>
                </MultiDataTrigger.ExitActions>
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_NonInteractive}"
           x:Key="A_Style_FZMaterial_CarLabelCentre">
        <Setter Property="Color" Value="{StaticResource A_Color_OpponentLabel_FullBackground}" />
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetGlass_CarLabelBackground}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Eliminator}">
                <Setter Property="Visibility" Value="Hidden"/>
             </DataTrigger>
        </Style.Triggers>
    </Style>

    <BitmapImage UriSource="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/ChatPill.png"
                 x:Key="A_Image_ChatPill_Cache" />
    <BitmapImage UriSource="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/StatusPill.png"
                 x:Key="A_Image_StatusPill_Cache" />

    <System:Double x:Key="A_Double_CarLabel_StatusPillContainer_Height">110</System:Double>
    <System:Double x:Key="A_Double_CarLabel_ChatPillContainer_Height">154</System:Double>

    <System:Double x:Key="A_Double_CarLabel_QuickChatPillContainer_Scale">1.0</System:Double>
    <System:Double x:Key="A_Double_CarLabel_StatusPillContainer_Scale">1.0</System:Double>

    <local:LinearTransformConverter x:Key="A_Converter_StatusPillHeightCalc" Scale="164" />

    <Style x:Key="A_Style_CarLabel_StatusPill"
           TargetType="local:FZMaterial">
        <Setter Property="Preset" Value="{GlassRoundtangle BlurAmount=High, CornerRadius=16}"/>
        <Setter Property="Color" Value="#33ffffff"/>
        <Setter Property="Height" Value="{StaticResource A_Double_CarLabel_StatusPillContainer_Height}"/>
        <Setter Property="Margin" Value="0,-280,0,0"/>
    </Style>

    <Style x:Key="A_Style_CarLabel_ChatPill"
           TargetType="local:FZMaterial">
        <Setter Property="UVMap">
            <Setter.Value>
                <local:FZMaterialUVMap StretchRegion="30,30,220,50"
                                   UnstretchedSize="268,154" />
            </Setter.Value>
        </Setter>
        <Setter Property="ImageSource" Value="{StaticResource A_Image_ChatPill_Cache}"/>
        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}"/>
        <Setter Property="Height" Value="{StaticResource A_Double_CarLabel_ChatPillContainer_Height}"/>
        <Setter Property="Margin" Value="0,-240,0,0"/>
    </Style>

    <Style x:Key="A_Style_Framework_Element_Eliminator_Visiblity"
           TargetType="FrameworkElement">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Eliminator}"/>
                    <Condition Binding="{Binding EliminatorCarInfo, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.Setters>
                    <Setter Property="Visibility" Value="Visible"/>
                </MultiDataTrigger.Setters>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>


    <Style x:Key="A_Style_Grid_OpponentText_Container" TargetType="Grid">
        <Setter Property="Margin" Value="15,0,15,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding CarLabelSessionMode}" Value="{x:Static local:CarLabelSessionMode.Eliminator}">
                <Setter Property="Margin" Value="-50,0,-21,0"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FrameworkElement_StatusPillHeightHelper" TargetType="FrameworkElement">
        <Setter Property="local:BindingProxy.AlwaysValidNumeric">
            <Setter.Value>
                <System:Double>0</System:Double>
            </Setter.Value>
        </Setter>
        <Setter Property="Height">
            <Setter.Value>
                <System:Double>0</System:Double>
            </Setter.Value>
        </Setter>
        <Setter Property="Tag"
                Value="{StaticResource A_Boolean_False}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="{StaticResource A_Boolean_True}">
                <Setter Property="Height"
                        Value="{Binding (local:BindingProxy.AlwaysValidNumeric), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_StatusPillHeightCalc}}" />
            </DataTrigger>
        </Style.Triggers>            
    </Style>

    <Style x:Key="A_Style_Grid_CarLabel_LabelHeight" TargetType="{Type Grid}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding CarLabelSessionMode}"
                         Value="{x:Static local:CarLabelSessionMode.Eliminator}">
                <Setter Property="Height" Value="120" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_StackPanel_CarLabel_TextBox" TargetType="StackPanel">
        <Setter Property="Margin" Value="40,0,40,0" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding ActualWidth, ElementName=PrestigeIcon, Converter={CompareConverter Value=0}}" Value="{x:Static CompareResult.GreaterThan}">
                <Setter Property="Margin" Value="10,0,10,0" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LightweightBackground" TargetType="FZMaterial">
    </Style>

</ResourceDictionary>
