<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:ForzaUI="clr-namespace:ForzaUI"
      x:Name="page"
      x:Class="ForzaUI.Scenes.Anthem.AR_OpponentLabel"
      mc:Ignorable="d"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      Opacity="0">
    <Page.Resources>
        <local:StringVisConverter x:Key="A_Converter_StringToVis" />
        <BooleanToVisibilityConverter x:Key="BoolVisConverter" />
        <local:AR_OpponentLabel_ContextData x:Key="ContextData" />

        <KeyTime x:Key="A_KeyTime_ConvoyActivationAnimation">0:0:0.6</KeyTime>
        <Duration x:Key="A_Duration_ConvoyActivationAnimation">0:0:0.6</Duration>
        <PowerEase x:Key="A_EasingFunction_ConvoyActivationAnimation"
                   EasingMode="EaseIn"
                   Power="5" />
        <CircleEase x:Key="A_EasingFunction_Circle_EaseOut"
                    EasingMode="EaseOut" />
        <KeyTime x:Key="A_KeyTime_ConvoyFlash_Duration">0:0:1.7</KeyTime>
        <System:Double x:Key="A_Double_ConvoyFlash_Scale">8</System:Double>

        <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlass_LightweightCarLabelBackground"
                                   CornerRadius="15"
                                   DepthTest="False"
                                   BlurAmount="Low"
                                   GlassColor="#FFFFFFFF" />

        <!-- NOTE: Don't mess with opacities in these storyboards; the codebehind is touching them directly -->
        <Storyboard x:Key="ShowLabel">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="page">
                <SplineDoubleKeyFrame KeyTime="0:0:0.333"
                                      Value="1" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="HideLabel">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="page">
                <SplineDoubleKeyFrame KeyTime="0:0:0.333"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="DetailedLabel">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="DetailedOpacity">
                <SplineDoubleKeyFrame KeyTime="0:0:0.333"
                                      Value="1" />
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="LightweightBackground">
              <LinearDoubleKeyFrame KeyTime="0:0:0.333"
                                    Value="0" />
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Key="SimpleLabel">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                           Storyboard.TargetName="DetailedOpacity">
                <SplineDoubleKeyFrame KeyTime="0:0:0.333"
                                      Value="0" />
            </DoubleAnimationUsingKeyFrames>
          <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                         Storyboard.TargetName="LightweightBackground">
            <SplineDoubleKeyFrame KeyTime="0:0:0.333"
                                  Value="1" />
          </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Style x:Key="A_Style_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" />
        </Style>

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

        <Style x:Key="A_Style_ClubTag"
               TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
            <Setter Property="Color"
                    Value="{StaticResource A_Color_TileSelected_Text}" />
            <Setter Property="CapHeight"
                    Value="61" />
            <Setter Property="VerticalAlignment"
                    Value="Center" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsSameClub}"
                             Value="True">
                    <Setter Property="Color"
                            Value="#FF00E2FF" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IntroducedClubs}"
                             Value="False">
                    <Setter Property="Visibility"
                            Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_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_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_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>
                <!-- 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:FZMaterialPresetRoundtangle CornerRadius="9,0,0,9"
                                           x:Key="A_FZMaterialPreset_PlayerLevel_Panel" />

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

        <ControlTemplate x:Key="A_ControlTemplate_LeftBox"
                         TargetType="{x:Type Control}">
            <Grid x:Name="Container"
                  Width="166"
                  Height="150">
                <Control Style="{Binding XP, Converter={StaticResource A_XPConverter}}"
                         x:Name="XP"
                         Visibility="Collapsed" />
                <local:FZMaterial Style="{StaticResource A_Style_LeftBox}" x:Name="Background" Margin="-0.5">
                    <local:FZMaterial.Preset>
                        <local:FZMaterialPresetRoundtangle CornerRadius="9,0,0,9" />
                    </local:FZMaterial.Preset>
                    <Grid>
                        <local:FZTextBlock x:Name="Text"
                                           Style="{StaticResource A_Style_LabelText}"
                                           Visibility="Collapsed"/>
                        <local:FZMaterial x:Name="Icon"
                                          Stretch="Uniform"
                                          Margin="0,-6,-4,-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/BurdenedKingA_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/BurdenedKingB_DriverLabel.png" />
                    <Setter TargetName="Icon"
                            Property="Margin"
                            Value="-16,-17" />
                </MultiDataTrigger>

                <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 TargetName="Container"
                            Property="Visibility"
                            Value="{Binding OpponentPlace, Converter={StaticResource A_Num_Visibility_Converter}, 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 TargetName="Container"
                            Property="Visibility"
                            Value="{Binding OpponentPlace, Converter={StaticResource A_Num_Visibility_Converter}, FallbackValue=Collapsed}"/>
                </DataTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

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

        <local:MappingConverter x:Key="A_Converter_CarLabelStatusIcon">
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.None}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/ConvoyIcon.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.Away}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Away.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.Copter}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Drone.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.SettingUpEvent}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/EventSetup.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.Map}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Map.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.Pause}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Pause.png" />
            <local:MappingConverterEntry Key="{x:Static local:CarLabelStatus.Photo}"
                                         Value="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Photo.png" />
        </local:MappingConverter>

        <Style x:Key="A_Style_FZMaterial_Convoy_Icon" TargetType="local:FZMaterial">
            <Setter Property="ImageSource" Value="{Binding Status, Converter={StaticResource A_Converter_CarLabelStatusIcon}}"/>
            <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding Status}" Value="{x:Static local:CarLabelStatus.None}"/>
                        <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>

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

        <ControlTemplate x:Key="A_ControlTemplate_RightBox"
                         TargetType="{x:Type Control}">
            <Grid Width="166"
                  Height="150"
                  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,9,9,0" />
                    </local:FZMaterial.Preset><!--bam-->
                    <local:FZMaterial x:Name="ConvoyIcon" Style="{StaticResource A_Style_FZMaterial_Convoy_Icon}"
                                      Stretch="Uniform"
                                      Color="#ffffff">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle CornerRadius="0,9,9,0" />
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </local:FZMaterial>

                <local:FZMaterial x:Name="Glow"
                                  ImageSource="{StaticResource A_ImageSource_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>
                <DataTrigger Binding="{Binding CarLabelSessionMode}"
                             Value="{x:Static local:CarLabelSessionMode.Freeroam}">
                    <Setter TargetName="Container"
                            Property="Visibility"
                            Value="Visible" />
                </DataTrigger>
                <DataTrigger Binding="{Binding IsInConvoy}"
                             Value="True">
                    <Setter TargetName="Background"
                            Property="Color"
                            Value="{StaticResource A_Color_DriverLabel_Convoy}" />
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <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>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                </DataTrigger>
                <DataTrigger Binding="{Binding IsConvoyRecruitmentEnabled}"
                             Value="False">
                    <Setter Property="Visibility"
                            Value="Collapsed" />
                </DataTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="A_Style_FZMaterial_PhotoNeededIcon"
               TargetType="local:FZMaterial">
            <Setter Property="Visibility"
                    Value="Collapsed" />
            <Style.Triggers>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding CarLabelSessionMode}" 
                                   Value="{x:Static local:CarLabelSessionMode.Freeroam}" />
                        <Condition Binding="{Binding IsPhotoNeeded}" 
                                   Value="True" />
                    </MultiDataTrigger.Conditions>
                    <Setter Property="Visibility"
                                Value="Visible" />
                </MultiDataTrigger>
                <DataTrigger Binding="{Binding IsHighValueTarget}"
                             Value="True">
                    <Setter Property="Visibility"
                            Value="Collapsed" />
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="A_Style_FZMaterial_H2HIcon"
               TargetType="local:FZMaterial">
            <Setter Property="Visibility"
                    Value="Collapsed" />
        </Style>

        <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_Trim}"
                                          HorizontalAlignment="Left"
                                          Width="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
                            <local:FZMaterial.Preset>
                                <local:FZMaterialPresetGlassRoundtangleStroke Thickness="8"
                                                                              CornerRadius="17" />
                            </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="8"
                                                                         CornerRadius="17" />
                            </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="Preset">
                <Setter.Value>

                    <local:FZMaterialPresetGlassRoundtangle BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}"
                                                            CornerRadius="0,9,9,0" />
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsConvoyRecruitmentEnabled}"
                             Value="True">
                    <Setter Property="Preset">
                        <Setter.Value>

                            <local:FZMaterialPresetGlassRoundtangle BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}"
                                                                    CornerRadius="0,0,0,0" />
                        </Setter.Value>
                    </Setter>
                </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" />

        
        <Storyboard x:Key="A_Storyboard_PopStatusBox"
                    FillBehavior="HoldEnd">

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="ChatText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="H2HIcon">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="StatusText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="ImageSource">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{StaticResource A_Image_StatusPill_Cache}" />
            </ObjectAnimationUsingKeyFrames>
            
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.03"
                                      Value="1" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:2.0"
                                        Value="1" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.Y)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="10" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:2.0"
                                        Value="10" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0.16" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.63"
                                      Value="1.0"
                                      EasingFunction="{local:ElasticEasing EasingMode=EaseOut, Oscillations=2, Springiness=7}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0.16" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.63"
                                      Value="1.0"
                                      EasingFunction="{local:ElasticEasing EasingMode=EaseOut, Oscillations=2, Springiness=7}" />
            </DoubleAnimationUsingKeyFrames>

        </Storyboard>

        <Storyboard x:Key="A_Storyboard_ClearStatusBox">

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="ChatText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Collapsed}" />
            </ObjectAnimationUsingKeyFrames>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="StatusText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
                <EasingDoubleKeyFrame KeyTime="0:0:0.42"
                                      Value="0"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseIn}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.Y)">
                <EasingDoubleKeyFrame KeyTime="0:0:0.42"
                                      Value="-64"
                                      EasingFunction="{local:QuinticEasing EasingMode=EaseIn}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)" />
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="ImageSource" />
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)" />
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="H2HIcon"
                                           BeginTime="0:0:0.42" />

        </Storyboard>

        
        <local:UIStoryboard x:Key="A_Storyboard_PopChatBox"
                    FillBehavior="HoldEnd">
            <local:UIStoryboard.TriggerAnimation>
                <local:RaiseFzEvent EventName="ChatComplete"
                                    local:TriggerAnimation.KeyTime="0:0:2.42" />
            </local:UIStoryboard.TriggerAnimation>

            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="ImageSource">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{StaticResource A_Image_ChatPill_Cache}" />
            </ObjectAnimationUsingKeyFrames>
            
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="ChatText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Visible}" />
            </ObjectAnimationUsingKeyFrames>
            
            <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility"
                                           Storyboard.TargetName="StatusText">
                <DiscreteObjectKeyFrame KeyTime="0:0:0"
                                        Value="{x:Static Visibility.Hidden}" />
            </ObjectAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <LinearDoubleKeyFrame KeyTime="0:0:0.03"
                                      Value="1" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:2.0"
                                        Value="1" />
                <EasingDoubleKeyFrame KeyTime="0:0:2.42"
                                      Value="0"
                                      EasingFunction="{local:QuadraticEasing EasingMode=EaseIn}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(TranslateTransform.Y)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0" />
                <DiscreteDoubleKeyFrame KeyTime="0:0:2.0"
                                        Value="0" />
                <EasingDoubleKeyFrame KeyTime="0:0:2.42"
                                      Value="-64"
                                      EasingFunction="{local:QuinticEasing EasingMode=EaseIn}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0.16" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.63"
                                      Value="1.6"
                                      EasingFunction="{local:ElasticEasing EasingMode=EaseOut, Oscillations=2, Springiness=7}" />
            </DoubleAnimationUsingKeyFrames>

            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                <DiscreteDoubleKeyFrame KeyTime="0:0:0"
                                        Value="0.16" />
                <EasingDoubleKeyFrame KeyTime="0:0:0.63"
                                      Value="1.6"
                                      EasingFunction="{local:ElasticEasing EasingMode=EaseOut, Oscillations=2, Springiness=7}" />
            </DoubleAnimationUsingKeyFrames>

        </local:UIStoryboard>

        <Style x:Key="A_Style_StatusPill"
               TargetType="local:FZMaterial">
            <Setter Property="UVMap">
                <Setter.Value>
                    <local:FZMaterialUVMap StretchRegion="164,82"
                                           UnstretchedSize="328,164" />
                </Setter.Value>
            </Setter>
            <Setter Property="RenderTransform">
                <Setter.Value>
                    <TransformGroup>
                        <ScaleTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </Setter.Value>
            </Setter>
        </Style>

    </Page.Resources>
    <Grid x:Name="LayoutRoot"
          Opacity="{Binding OpacityOverride}"
          RenderTransformOrigin="0.5,0.5">
        <Grid.RenderTransform>
            <ScaleTransform ScaleX="1.3"
                            ScaleY="1.3" />
        </Grid.RenderTransform>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>
        <Grid>
            <FrameworkElement.Style>
                <Style TargetType="Grid">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding CarLabelSessionMode}"
                                     Value="{x:Static local:CarLabelSessionMode.Rivals}">
                            <Setter Property="Visibility"
                                    Value="Collapsed" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </FrameworkElement.Style>
            <Decorator x:Name="DetailedOpacity">
                <Grid VerticalAlignment="Bottom"
                      Height="235">
                    <Grid x:Name="TrimSize"
                          HorizontalAlignment="Center"
                          VerticalAlignment="Center">
                        <StackPanel Orientation="Horizontal"
                                    Height="150"
                                    Margin="7.5">
                            <Control Template="{StaticResource A_ControlTemplate_LeftBox}"
                                     Panel.ZIndex="5"
                                     x:Name="LeftBox" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_CarLabelCentre}">
                                <StackPanel Orientation="Horizontal">
                                    <Viewbox Visibility="{Binding XP, Converter={StaticResource A_Converter_PrestigeLevelToVisibilityFromXP}, FallbackValue=Collapsed}"
                                             VerticalAlignment="Center"
                                             Margin="15">
                                        <Grid>
                                            <StackPanel Margin="3,1,0,0">
                                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PrestigeIcon}"
                                                                  Color="{StaticResource A_Color_DropShadow}" />
                                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PrestigeLevel}"
                                                                   Text="{Binding XP, Converter={StaticResource A_XPConverter_Prestige}}"
                                                                   Color="{StaticResource A_Color_DropShadow}" />
                                            </StackPanel>
                                            <StackPanel>
                                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PrestigeIcon}" />
                                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PrestigeLevel}"
                                                                   Text="{Binding XP, Converter={StaticResource A_XPConverter_Prestige}}" />
                                            </StackPanel>
                                        </Grid>
                                    </Viewbox>
                                    <Decorator Width="{Binding ActualWidth, ElementName=TextBox}" />
                                </StackPanel>
                            </local:FZMaterial>
                            <Control Template="{StaticResource A_ControlTemplate_RightBox}"
                                     x:Name="RightBox" />
                        </StackPanel>

                        <local:FZMaterial Color="{StaticResource A_Color_Interaction_Activated}"
                                          Visibility="{Binding Interacting, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}">
                            <local:FZMaterial.Preset>
                                <local:FZMaterialPresetRoundtangleStroke Thickness="8"
                                                                         CornerRadius="17" />
                            </local:FZMaterial.Preset>
                        </local:FZMaterial>
                    </Grid>
                    <Control Template="{StaticResource A_Template_Control_CarLabelTrim}"
                             Width="{Binding ActualWidth, ElementName=TrimSize}"
                             Height="{Binding ActualHeight, ElementName=TrimSize}"
                             Panel.ZIndex="-1"
                             Visibility="{Binding Interacting, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden_Inverse}}" />
                    <StackPanel HorizontalAlignment="Center"
                        VerticalAlignment="Bottom"
                        Margin="0,0,0,215"
                                Orientation="Horizontal">
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Placeholder/photo_collection.png"
                                          Width="160"
                                          Height="160"
                                          Stretch="UniformToFill"
                                  VerticalAlignment="Bottom"
                                  Margin="5,0,5,-16"
                                          Style="{StaticResource A_Style_FZMaterial_PhotoNeededIcon}"
                                          x:Name="PhotoIcon" />
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/H2H_Target.png"
                                  Width="185"
                                  Height="185"
                                  Stretch="UniformToFill"
                                  VerticalAlignment="Bottom"
                                  Margin="5,0,5,0"
                                  Style="{StaticResource A_Style_FZMaterial_H2HIcon}"
                                  x:Name="H2HIcon" />
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/HVTIcon.png"
                                  Width="185"
                                  Height="185"
                                          Stretch="UniformToFill"
                                  VerticalAlignment="Bottom"
                                  Margin="5,0,5,0"
                                          Visibility="{Binding IsHighValueTarget, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                          x:Name="HVTIcon" />
                    </StackPanel>

                    <local:FZMaterial Height="164"
                                      HorizontalAlignment="Center"
                                      MinWidth="350"
                                      Margin="0,-245,0,0"
                                      RenderTransformOrigin="0.5,1"
                                      Opacity="0"
                                      ImageSource="{StaticResource A_Image_StatusPill_Cache}"
                                      Style="{StaticResource A_Style_StatusPill}"
                                      x:Name="StatusPill">
                        <Grid>
                            <local:FZTextBlock Text="{Binding StatusText}"
                                               x:Name="StatusText"
                                               Color="#FFFFFF"
                                               Style="{StaticResource A_Style_QuickChat}" />
                            <local:FZTextBlock Text="{Binding ChatText}"
                                               Style="{StaticResource A_Style_QuickChat}"
                                               x:Name="ChatText" 
                                               Visibility="Collapsed"/>
                        </Grid>
                    </local:FZMaterial>

                    <local:FZMaterial VerticalAlignment="Bottom"
                                      Width="164"
                                      Height="164"
                                      Margin="0,0,0,-100"
                                      ImageSource="/ForzaUI;component/Textures/Anthem/Icons/Spatial/Driverlabel/Arrow.png" />
                </Grid>

            </Decorator>
            
            <Grid VerticalAlignment="Bottom"
                  Height="235">
                <Grid HorizontalAlignment="Center"
                      VerticalAlignment="Center">
                    <StackPanel Orientation="Horizontal"
                                Height="150"
                                Margin="7.5">
                        <Decorator Width="{Binding ActualWidth, ElementName=LeftBox}" Visibility="{Binding Visibility, ElementName=LeftBox}" />
                        <Decorator x:Name="TextBox" >
                            <Grid Margin="60,0,55,0">
                                <local:FZMaterial x:Name="LightweightBackground" Color="#00AAAAAA"
                                                  Preset="{StaticResource A_FZMaterialPresetGlass_LightweightCarLabelBackground}" Opacity="0"/>
                                <StackPanel Orientation="Horizontal" Margin="15,0,15,0">
                                      <Grid Margin="0,0,25,0"
                                            Visibility="{Binding UserProfile.FormattedClubTag, Converter={StaticResource A_Converter_StringToVis}}">
                                          <local:FZTextBlock Style="{StaticResource A_Style_ClubTag}"
                                                              Text="{Binding UserProfile.FormattedClubTag}"
                                                              Color="{StaticResource A_Color_DropShadow}"
                                                              Margin="7,7,0,0">
                                              <local:FZTextBlock.Preset>
                                                  <local:FZMaterialPreset DepthTest="{Binding IsLightweightLabelFeatureEnabled, Converter={StaticResource A_Converter_Boolean_Invert}}" />
                                              </local:FZTextBlock.Preset>
                                          </local:FZTextBlock>
                                          <local:FZTextBlock Style="{StaticResource A_Style_ClubTag}"
                                                              Text="{Binding UserProfile.FormattedClubTag}">
                                              <local:FZTextBlock.Preset>
                                                  <local:FZMaterialPreset DepthTest="{Binding IsLightweightLabelFeatureEnabled, Converter={StaticResource A_Converter_Boolean_Invert}}" />
                                              </local:FZTextBlock.Preset>
                                          </local:FZTextBlock>
                                      </Grid>
                                      <Grid>
                                          <local:FZTextBlock Style="{StaticResource A_Style_OpponentTag}"
                                                              Text="{Binding UserProfile.FormattedGamertag}"
                                                              Color="{StaticResource A_Color_DropShadow}"
                                                              Margin="7,7,0,0">
                                              <local:FZTextBlock.Preset>
                                                  <local:FZMaterialPreset DepthTest="{Binding IsLightweightLabelFeatureEnabled, Converter={StaticResource A_Converter_Boolean_Invert}}" />
                                              </local:FZTextBlock.Preset>
                                          </local:FZTextBlock>
                                          <local:FZTextBlock Style="{StaticResource A_Style_OpponentTag}"
                                                          Text="{Binding UserProfile.FormattedGamertag}">
                                              <local:FZTextBlock.Preset>
                                                  <local:FZMaterialPreset DepthTest="{Binding IsLightweightLabelFeatureEnabled, Converter={StaticResource A_Converter_Boolean_Invert}}" />
                                              </local:FZTextBlock.Preset>
                                          </local:FZTextBlock>
                                      </Grid>

                                  </StackPanel>
                            </Grid>
                        </Decorator>
                        <Decorator Width="{Binding ActualWidth, ElementName=RightBox}" Visibility="{Binding Visibility, ElementName=RightBox}"/>
                    </StackPanel>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
    <local:EventFire.FzTriggers>
        <local:BeginUIStoryboard local:EventFireTrigger.Event="NewChat"
                                 x:Name="NewChat"
                                 local:EventFireTrigger.TargetName="StatusPill"
                                 Storyboard="{StaticResource A_Storyboard_PopChatBox}" />
        <local:BeginUIStoryboard local:EventFireTrigger.Event="NewStatus"
                                 x:Name="NewStatus"
                                 local:EventFireTrigger.TargetName="StatusPill"
                                 Storyboard="{StaticResource A_Storyboard_PopStatusBox}" />
        <StopStoryboard local:EventFireTrigger.Event="NewStatus"
                        local:EventFireTrigger.TargetName="StatusPill"
                        BeginStoryboardName="NewChat" />
        <local:BeginUIStoryboard local:EventFireTrigger.Event="ClearStatus"
                                 local:EventFireTrigger.TargetName="StatusPill"
                                 Storyboard="{StaticResource A_Storyboard_ClearStatusBox}" />
    </local:EventFire.FzTriggers>
</Page>
