<UserControl
    DataContext="{Binding (HUDData.Data), RelativeSource={RelativeSource Self}}" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    mc:Ignorable="d"
    xmlns:local="clr-namespace:ForzaUI"
    x:Class="ForzaUI.HUDMiniLeaderboardControl"
    x:Name="UserControl"
    HorizontalAlignment="Right"
    VerticalAlignment="Top"
    Margin="0,0,0,0">
    <UserControl.Resources>
        <ResourceDictionary>

            <Thickness x:Key="A_Thickness_TemplateSelectionTitleMargin">0,0,0,8</Thickness>
            <Thickness x:Key="A_Thickness_LeaderboardItemMargin">0,0,0,4</Thickness>

            <QuadraticEase x:Key="A_EasingFunction_EaseIn" EasingMode="EaseIn"/>

            <System:Double x:Key="A_Double_MiniLeaderboard_IconSize">36</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_RowWidth">350</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_ConvoyRowWidth">350</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_Score_RowWidth">388</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_Time_RowWidth">400</System:Double>

            <System:Double x:Key="A_Double_MiniLeaderboard_ScoreWidth">68</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_TimeWidth">70</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_SplitTimeWidth">116</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_TextWidth">272</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_TextWidth_WithScore">240</System:Double>
            <System:Double x:Key="A_Double_MiniLeaderboard_TextWidth_WithTime">224</System:Double>

            <Style x:Key="A_Style_FZMaterial_LeaderboardRow_HorizontalDivider" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Height" Value="1" />
                <Setter Property="Margin" Value="8,0" />
                <Setter Property="Color" Value="#1AF7F7F7" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_Glass_MiniLeaderboard" TargetType="local:FZMaterial">
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_DefaultGlass}" />
                <Setter Property="Preset" Value="{FZMaterialPresetGlass BlurAmount=Medium}" />
                <Setter Property="Height" Value="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboard_Score" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Glass_MiniLeaderboard}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_ScoreWidth}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboard_Time" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Glass_MiniLeaderboard}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_TimeWidth}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboard_SplitTime" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_Glass_MiniLeaderboard}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_SplitTimeWidth}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboard_SplitTimeDark" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTime}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_SplitTimeWidth}" />
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_DarkGlass}" />
            </Style>

            <Style x:Key="A_Style_FZText_MiniLeaderboard_Score" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HudMedium}">
                <Setter Property="FontFamily" Value="Horizon_B_tf" />
                <Setter Property="CapHeight" Value="18" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="TextAlignment" Value="Center" />
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_ScoreWidth}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter Property="FontFamily" Value="Horizon_A_tf" />
                        <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerText}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZText_MiniLeaderboard_Time" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZText_MiniLeaderboard_Score}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_TimeWidth}" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_MiniLeaderboard_Header" TargetType="{x:Type local:FZTextBlock}">
                <Setter Property="FontFamily" Value="Horizon_A_tf"/>
                <Setter Property="CapHeight" Value="20" />
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
            </Style>

            <TransformGroup x:Key="A_TransformGroup_HorizFlip">
                <ScaleTransform ScaleY="1" ScaleX="-1" />
                <SkewTransform/>
                <RotateTransform/>
                <TranslateTransform/>
            </TransformGroup>


            <Style x:Key="A_Style_Slider_TeamScore" TargetType="{x:Type Slider}">
                <Setter Property="Focusable" Value="False"/>
                <Setter Property="Minimum" Value="0"/>
                <Setter Property="Maximum" Value="{Binding TotalScore}"/>
                <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
                <Setter Property="OverridesDefaultStyle" Value="True"/>
                <Setter Property="IsHitTestVisible" Value="False" />
                <Setter Property="local:BindingProxy.A" Value="{StaticResource A_FZMaterialPresetGlass_Standard}" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type Slider}">
                            <Grid>
                                <Track  Focusable="False">
                                    <Track.DecreaseRepeatButton>
                                        <RepeatButton Focusable="False">
                                            <RepeatButton.Template>
                                                <ControlTemplate>
                                                    <Grid Focusable="False" x:Name="PART_Track">
                                                        <local:FZMaterial x:Name="BarMaterial" Color="{Binding Tag, RelativeSource={RelativeSource FindAncestor, AncestorType=Slider}}" Preset="{Binding Path=(local:BindingProxy.A), RelativeSource={RelativeSource FindAncestor, AncestorType=Slider}}"/>
                                                    </Grid>
                                                </ControlTemplate>
                                            </RepeatButton.Template>
                                        </RepeatButton>
                                    </Track.DecreaseRepeatButton>
                                </Track>
                            </Grid>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_Slider_TeamScore_Left" TargetType="{x:Type Slider}" BasedOn="{StaticResource A_Style_Slider_TeamScore}">
                <Setter Property="Value" Value="{Binding TeamLeftScore}"/>
                <Setter Property="Tag" Value="{StaticResource A_Color_MiniLeaderboard_Team_Left_TitleBackground}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Tag" Value="{StaticResource A_Color_MiniLeaderboard_Infected_TitleBackground}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Slider_TeamScore_Right" TargetType="{x:Type Slider}" BasedOn="{StaticResource A_Style_Slider_TeamScore}">
                <Setter Property="Value" Value="{Binding TeamRightScore}"/>
                <Setter Property="Tag" Value="{StaticResource A_Color_MiniLeaderboard_Team_Right_TitleBackground}"/>
                <Setter Property="RenderTransform" Value="{StaticResource A_TransformGroup_HorizFlip}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Tag" Value="{StaticResource A_Color_MiniLeaderboard_Survivor_TitleBackground}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FastTextBlock_Score" TargetType="{x:Type local:FastTextBlock}">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="FontSize" Value="28"/>
                <Setter Property="Margin" Value="12,-4"/>
                <Setter Property="FontFamily" Value="Horizon_A_tf"/>
                <Setter Property="Color" Value="{StaticResource A_Color_HUD_Text}" />
                <Setter Property="Effect" Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
            </Style>

            <Style TargetType="{x:Type local:FastTextBlock}" x:Key="A_Style_FastTextBlock_MiniLeaderboard_Place" BasedOn="{StaticResource A_Style_FastTextBlock_HudMedium}">
                <Setter Property="Margin" Value="0,0,0,2" />
                <Setter Property="FontSize" Value="25" />
                <Setter Property="HorizontalAlignment" Value="Center" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="FontFamily" Value="Horizon_C_tf"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerText}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" />
                <Setter Property="Height" Value="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Left" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" />
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_Team_Left_IconBackground}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_Infected_IconBackground}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Right" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" />
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_Team_Right_IconBackground}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_Survivor_IconBackground}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_Red.png"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Infected.png"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_Blue.png"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Survivor.png"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_MiniLeaderboardText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HUDBase}">
                <Setter Property="Stretch" Value="Uniform" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="HorizontalAlignment" Value="Left" />
                <Setter Property="Margin" Value="6,0,0,0" />
                <Setter Property="CapHeight" Value="18" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter Property="FontFamily" Value="Horizon_A_tf" />
                        <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerText}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboardRow" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_Glass_MiniLeaderboard}">
                <Setter Property="Height" Value="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" />
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_RowWidth}" />
                <Setter Property="HorizontalAlignment" Value="Right" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboardRowDark" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}">
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_DarkGlass}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboardRowWithScore" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowDark}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_Score_RowWidth}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboardRowWithTime" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowDark}">
                <Setter Property="Width" Value="{StaticResource A_Double_MiniLeaderboard_Time_RowWidth}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboard_Place" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_Glass_MiniLeaderboard}">
                <Setter Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_PlaceMaterial}" />
                <Setter Property="Height" Value="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" />
                <Setter Property="Width" Value="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_MiniLeaderboard_Position" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HUDBase}">
                <Setter Property="CapHeight" Value="55.5"/>
                <Setter Property="FontFamily" Value="Horizon_A_tf"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_PartyIcon_MiniLeaderboard"
                TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Opacity" Value="0"/>
                <Setter Property="Margin" Value="3,0" />
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Convoy.png"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=DataContext.RaceModeTemplateName, RelativeSource={RelativeSource FindAncestor, AncestorType=local:CommonListBox}}" Value="Party">
                        <Setter Property="Opacity" Value="0"/>
                    </DataTrigger>
                    
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsInPartyWithLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsConnecting}" Value="False"/>
                            <Condition Binding="{Binding HasNetworkWarning}" Value="false"/>
                            <Condition Binding="{Binding InEvent}" Value="False"/>
                            <Condition Binding="{Binding RichPresenceIcon, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="False"/>
                            <Condition Binding="{Binding RichPresenceIconOverride, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Opacity" Value="1"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_DisconnectedIcon_MiniLeaderboard"
                TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Opacity" Value="0"/>
                <Setter Property="Margin" Value="3,0" />
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Disconnected.png"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding Path=DataContext.RaceModeTemplateName, RelativeSource={RelativeSource FindAncestor, AncestorType=local:CommonListBox}}" Value="Party">
                        <Setter Property="Opacity" Value="0"/>
                    </DataTrigger>

                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding HasNetworkWarning}" Value="True"/>
                            <Condition Binding="{Binding IsInPartyWithLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsConnecting}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Opacity" Value="1"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>
            <!-- These Templates determine what is displayed on the minileaderboard. -->
            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_Default"
                             TargetType="ContentControl">
                <StackPanel Orientation="Horizontal"
                            HorizontalAlignment="Right"
                            FlowDirection="LeftToRight"
                            RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}"
                            RenderTransformOrigin="0.5,0.5"
                            Margin="0,0,0,20">
                    <local:FZTextBlock Text="{local:Loc InGame.IDS_Position}"
                                       Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Position}"
                                       CapHeight="24.5"
                                       Margin="0,0,15,0"/>
                    <local:FZTextBlock Text="{Binding PlayerPosition}"
                                       Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Position}" />
                    <local:FZTextBlock Text="/"
                                       Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Position}" />
                    <local:FZTextBlock Text="{Binding ParticipantCount}"
                                       Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Position}" />
                </StackPanel>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamScores">
                <Grid HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <Grid DockPanel.Dock="Left" x:Name="TeamLeft">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Left}" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid DockPanel.Dock="Right" x:Name="TeamRight">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Right}" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Left}"/>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Right}"/>
                            <local:FastTextBlock Text="{Binding TeamLeftScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Left"/>
                            <local:FastTextBlock Text="{Binding TeamRightScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Right"/>
                        </Grid>
                    </DockPanel>
                </Grid>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamScoresWithPosition">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="8"/>
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    <ContentControl Template="{StaticResource A_ControlTemplate_ContentControl_Default}"/>
                    <Control Grid.Row="2" Template="{StaticResource A_ControlTemplate_ContentControl_TeamScores}" />
                </Grid>
            </ControlTemplate>


            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamInfectedScores">
                <Grid HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <Grid DockPanel.Dock="Left" x:Name="TeamLeft">
                            <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Contaminated_IconBackground}" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}" GreedyMeasure="True" Stretch="Uniform" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Contaminated.png" />
                        </Grid>
                        <Grid DockPanel.Dock="Right" x:Name="TeamRight">
                            <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Survivor_IconBackground}" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}" GreedyMeasure="True" Stretch="Uniform" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Survivor.png" />
                        </Grid>
                        <Grid>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Left}" Tag="{StaticResource A_Color_MiniLeaderboard_Contaminated_TitleBackground}"/>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Right}"/>
                            <local:FastTextBlock Text="{Binding TeamLeftScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Left"/>
                            <local:FastTextBlock Text="{Binding TeamRightScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Right"/>
                        </Grid>
                    </DockPanel>
                </Grid>
            </ControlTemplate>

            <local:ElapsedTimeConverter x:Key="A_Converter_ElapsedTime" />

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamKingScores">
                <Grid HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <Grid DockPanel.Dock="Left">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Left}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid DockPanel.Dock="Right">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Right}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Left}"/>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Right}"/>
                            <local:FastTextBlock Text="{Binding TeamLeftScore, Converter={StaticResource A_Converter_ElapsedTime}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Left"/>
                            <local:FastTextBlock Text="{Binding TeamRightScore, Converter={StaticResource A_Converter_ElapsedTime}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Right"/>
                        </Grid>
                    </DockPanel>
                </Grid>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamFlagRushScores">
                <Grid HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <Grid DockPanel.Dock="Left" x:Name="TeamLeft">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Left}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid DockPanel.Dock="Right" x:Name="TeamRight">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIconBackground_Right}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right}" GreedyMeasure="True" Stretch="Uniform" />
                        </Grid>
                        <Grid>
                            <Slider x:Name="LeftBar" Style="{StaticResource A_Style_Slider_TeamScore_Left}"/>
                            <Slider x:Name="RightBar" Style="{StaticResource A_Style_Slider_TeamScore_Right}"/>
                            <local:FastTextBlock Text="{Binding TeamLeftScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Left"
                                               x:Name="LeftText"/>
                            <local:FastTextBlock Text="{Binding TeamRightScore, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                               Style="{StaticResource A_Style_FastTextBlock_Score}"
                                               HorizontalAlignment="Right"
                                               x:Name="RightText"/>
                            <local:FZMaterial x:Name="VictoryLine"  Width="4" Color="#66000000" HorizontalAlignment="Center"/>
                        </Grid>
                    </DockPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding TeamScores.CurrentRound}" Value="1"/>
                            <Condition Binding="{Binding TeamScores.AttackingTeam}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="TeamRight" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="RightText" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="LeftBar" Property="Maximum" Value="1"/>
                        <Setter TargetName="LeftBar" Property="Value" Value="1"/>
                        <Setter TargetName="RightBar" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="VictoryLine" Property="Visibility" Value="Collapsed"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding TeamScores.CurrentRound}" Value="1"/>
                            <Condition Binding="{Binding TeamScores.AttackingTeam}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="TeamLeft" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="LeftText" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="RightBar" Property="Maximum" Value="1"/>
                        <Setter TargetName="RightBar" Property="Value" Value="1"/>
                        <Setter TargetName="LeftBar" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="VictoryLine" Property="Visibility" Value="Collapsed"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding TeamScores.CurrentRound}" Value="2"/>
                            <Condition Binding="{Binding TeamScores.TeamLeftScore}" Value="0"/>
                            <Condition Binding="{Binding TeamScores.TeamRightScore}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="RightBar" Property="Maximum" Value="1"/>
                        <Setter TargetName="LeftBar" Property="Maximum" Value="1"/>
                        <Setter TargetName="RightBar" Property="Value" Value="0.5"/>
                        <Setter TargetName="LeftBar" Property="Value" Value="0.5"/>
                    </MultiDataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_StuntPartyCount">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource A_Color_HUD_PartyListTypeBackground_StuntParty}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_MiniLeaderboard_Highlight}"
                                          Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"
                                          HorizontalAlignment="Right">
                            <local:FZTextBlock Text="{Binding MemberDisplayCount}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"/>
                        </local:FZMaterial>
                        <StackPanel Orientation="Horizontal">
                            <local:FZTextBlock Text="{local:Loc ForzaEvents.IDS_ForzathonLive_PlayerList_CountText}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Margin="10"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_HorizonStoryCount">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource A_Color_MiniLeaderboard_Party_TitleBackground}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_MiniLeaderboard_PlaceMaterial}"
                                          HorizontalAlignment="Right">
                            <local:FZTextBlock Text="{Binding MemberDisplayCount}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               FontFamily="Horizon_A_tf"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"/>
                        </local:FZMaterial>
                        <StackPanel Orientation="Horizontal">
                            <local:FZTextBlock Text="{local:Loc BucketList.IDS_HorizonStory_PlayerList_CountText}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               FontFamily="Horizon_A_tf"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Margin="10"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" Margin="0" Opacity="1"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_JobCount">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource A_Color_MiniLeaderboard_Party_TitleBackground}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_MiniLeaderboard_PlaceMaterial}"
                                          HorizontalAlignment="Right">
                            <local:FZTextBlock Text="{Binding MemberDisplayCount}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               FontFamily="Horizon_A_tf"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"/>
                        </local:FZMaterial>
                        <StackPanel Orientation="Horizontal">
                            <local:FZTextBlock Text="{local:Loc BucketList.IDS_Job_PlayerList_CountText}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               FontFamily="Horizon_A_tf"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Margin="10"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" Margin="0" Opacity="1"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_StarScoring_Tile">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource H_Color_Primary_Green}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <StackPanel Orientation="Horizontal">
                            <local:FZTextBlock Text="{local:Loc Scoreboard.IDS_Star_Scoring_Race}"
                                               Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Header}"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Margin="10"/>
                        </StackPanel>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_PartyCount">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource H_Color_Primary_Green}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="#33000000"
                                          HorizontalAlignment="Right">
                            <local:FZTextBlock Text="{Binding MemberDisplayCount}"
                                               Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Header}"
                                               FontFamily="Horizon_A" 
                                               CapHeight="18"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"/>
                        </local:FZMaterial>
                        <local:FZTextBlock Text="{local:Loc InGame.IDS_GameParty}"
                                           Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboard_Header}"
                                           FontFamily="Horizon_A" 
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="Left"
                                           Margin="10,0"/>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_SessionCount">
                <local:FZMaterial x:Name="MainMaterial"
                                  Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                  VerticalAlignment="Top"
                                  HorizontalAlignment="Left"
                                  Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"
                                  Color="{StaticResource A_Color_MiniLeaderboard_Session_TitleBackground}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_MiniLeaderboard_Highlight}"
                                          HorizontalAlignment="Right">
                            <local:FZTextBlock Text="{Binding MemberDisplayCount}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               FontFamily="Horizon_A_tf"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Center"/>
                        </local:FZMaterial>
                        <local:FZTextBlock Text="{Binding Source={local:Loc InGame.IDS_Players}, Converter={StaticResource A_StringToUpper}}"
                                           Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                           FontFamily="Horizon_A_tf"
                                           VerticalAlignment="Center"
                                           HorizontalAlignment="Left"
                                           Margin="10"/>
                    </Grid>
                </local:FZMaterial>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_Invisible" TargetType="ContentControl">
                <!-- Intentionally left empty -->
            </ControlTemplate>

            <Style x:Key="A_Style_FZMaterial_IconTranslator" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="local:ZPanel.DisableClipping" Value="True" />
                <Setter Property="Margin" Value="-40,0,0,0" />
                <Setter Property="Color" Value="#00FFFFFF" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_SplitTimeTranslator" TargetType="{x:Type local:FZMaterial}"
                BasedOn="{StaticResource A_Style_FZMaterial_IconTranslator}">
                <Setter Property="Margin" Value="-118,0,0,0" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_LeaderIconTranslator" TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_IconTranslator}">
                <Setter Property="Margin" Value="0,0,-38,0" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_EventIcon"
                TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Opacity" Value="0"/>
                <Setter Property="Margin" Value="3,0" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLeader}" Value="False"/>
                            <Condition Binding="{Binding InEvent}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                            <Setter Property="Opacity" Value="1"/>
                        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Flag.png"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_LeaderIconContainer" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Color" Value="#22000000"/>
                <Setter Property="Preset" Value="{FZMaterialPresetGlass BlurAmount=Medium}"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="Width" Value="36"/>
                <Setter Property="Visibility" Value="Collapsed" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLeader}" Value="True">
                        <Setter Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_LeaderIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Leader.png" />
                <Setter Property="Width" Value="32" />
                <Setter Property="Height" Value="32" />
                <Setter Property="Margin" Value="3,0" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_RichPresenceIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSource" Value="{Binding RichPresenceIcon}" />
                <Setter Property="Width" Value="32" />
                <Setter Property="Height" Value="32" />
                <Setter Property="Visibility" Value="Collapsed" />
                <Setter Property="Margin" Value="3,0" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsConnecting}" Value="False"/>
                            <Condition Binding="{Binding InEvent}" Value="False"/>
                            <Condition Binding="{Binding RichPresenceIcon, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="True"/>
                            <Condition Binding="{Binding RichPresenceIconOverride, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="False"/>
                            <Condition Binding="{Binding HasNetworkWarning}" Value="false"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_RichPresenceIconOverride" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSource" Value="{Binding RichPresenceIconOverride}" />
                <Setter Property="Width" Value="32" />
                <Setter Property="Height" Value="32" />
                <Setter Property="Visibility" Value="Collapsed" />
                <Setter Property="Margin" Value="3,0" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsConnecting}" Value="False"/>
                            <Condition Binding="{Binding InEvent}" Value="False"/>
                            <Condition Binding="{Binding RichPresenceIconOverride, Converter={StaticResource A_Converter_TrueIfNotNull}}" Value="True"/>
                            <Condition Binding="{Binding HasNetworkWarning}" Value="false"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ProgressBar_WaitSpinner_Connecting" BasedOn="{StaticResource A_Style_ProgressBar_WaitSpinner}" TargetType="{x:Type ProgressBar}">
                <Setter Property="Width" Value="26" />
                <Setter Property="Height" Value="26" />
                <Setter Property="Margin" Value="6,0" />
                <Setter Property="IsIndeterminate" Value="True" />
                <Setter Property="Visibility" Value="Hidden" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsVisible}" Value="{StaticResource A_Boolean_True}" />
                            <Condition Binding="{Binding IsConnecting}" Value="{StaticResource A_Boolean_True}" />
                            <Condition Binding="{Binding Visibility, RelativeSource={RelativeSource AncestorType={x:Type local:CommonListBox}}}" Value="{x:Static Visibility.Visible}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_PillBackgroundColor"
                   TargetType="{x:Type FZMaterial}">
                <Setter Property="Height" Value="36"/>
                <Setter Property="Opacity" Value="0.2"/>
            </Style>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Invisible">
                <!-- Intentionally left empty -->
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Default">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_SplitTimeTranslator}">
                        <local:FZMaterial x:Name="SplitMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTime}" Color="{StaticResource A_Color_MiniLeaderboard_DefaultGlass}" Height="Auto" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" >
                            <local:FZTextBlock Text="{Binding Split}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
                        </local:FZMaterial>
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}" />
                            </local:FZMaterial>
                            <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth}">
                                <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                            </StackPanel>
                        </DockPanel>
                    </local:FZMaterial>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="SplitMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Party">
                <StackPanel Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <Grid Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_SplitTimeTranslator}">
                            <local:FZMaterial x:Name="SplitMaterial" 
                                              Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTime}" 
                                              Color="{StaticResource A_Color_MiniLeaderboard_DefaultGlass}" 
                                              Margin="0,0" 
                                              Height="Auto" 
                                              Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" 
                                              HorizontalAlignment="Left" >
                                <Decorator RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}" Margin="4,0">
                                    <local:FZTextBlock x:Name="SplitText" 
                                                       Text="{Binding Split}" 
                                                       Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"
                                                       HorizontalAlignment="Center" 
                                                       VerticalAlignment="Center"/>
                                </Decorator>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"/>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_MiniLeaderboard_DefaultGlass}"
                                          HorizontalAlignment="Right">
                            <Grid>
                                <local:FZMaterial x:Name="EventIcon" Style="{StaticResource A_Style_FZMaterial_EventIcon}" HorizontalAlignment="Right"/>
                                <local:FZMaterial x:Name="RichPresenceIconOverride" Style="{StaticResource A_Style_FZMaterial_RichPresenceIconOverride}" HorizontalAlignment="Right"/>
                                <local:FZMaterial x:Name="RichPresenceIcon" Style="{StaticResource A_Style_FZMaterial_RichPresenceIcon}" HorizontalAlignment="Right"/>
                                <local:FZMaterial x:Name="PartyIcon" Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" HorizontalAlignment="Right"/>
                                <local:FZMaterial x:Name="DisconnectedIcon" Style="{StaticResource A_Style_FZMaterial_DisconnectedIcon_MiniLeaderboard}" HorizontalAlignment="Right"/>
                                <ProgressBar x:Name="WaitSpinner" Style="{StaticResource A_Style_ProgressBar_WaitSpinner_Connecting}" HorizontalAlignment="Right"/>
                            </Grid>
                        </local:FZMaterial>
                        <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Width="{StaticResource A_Double_MiniLeaderboard_TextWidth}">
                            <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                            <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                        </StackPanel>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderIconTranslator}">
                            <local:FZMaterial x:Name="LeaderMaterial" Style="{StaticResource A_Style_FZMaterial_LeaderIconContainer}">
                                <local:FZMaterial x:Name="LeaderIcon" Style="{StaticResource A_Style_FZMaterial_LeaderIcon}"/>
                            </local:FZMaterial>
                        </local:FZMaterial>
                    </Grid>
                    <FZMaterial Visibility="{Binding ShowSeparator, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="0,0,0,4" Height="2"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="SplitMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="LeaderMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="SplitText" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="SplitText" Property="FontFamily" Value="Horizon_A_tf" />
                        <Setter TargetName="EventIcon" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="LeaderIcon" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="PartyIcon" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="RichPresenceIcon" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="RichPresenceIconOverride" Property="Color" Value="{StaticResource H_Color_Primary_Yellow}" />
                        <Setter TargetName="WaitSpinner" Property="Tag" Value="{StaticResource H_Color_Primary_Yellow}" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_HorizonStory">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}"/>
                    <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                        Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                        Color="{StaticResource A_Color_MiniLeaderboard_PlaceMaterial}"
                                        HorizontalAlignment="Right">
                        <Grid>
                            <local:FZMaterial x:Name="RichPresenceIconOverride" Style="{StaticResource A_Style_FZMaterial_RichPresenceIconOverride}" HorizontalAlignment="Right"/>
                            <local:FZMaterial x:Name="RichPresenceIcon" Style="{StaticResource A_Style_FZMaterial_RichPresenceIcon}" HorizontalAlignment="Right"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" HorizontalAlignment="Right"/>
                        </Grid>
                    </local:FZMaterial>
                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" Width="{StaticResource A_Double_MiniLeaderboard_TextWidth}">
                        <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                    </StackPanel>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderIconTranslator}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderIconContainer}">
                            <local:FZMaterial x:Name="LeaderIcon" Style="{StaticResource A_Style_FZMaterial_LeaderIcon}"/>
                        </local:FZMaterial>
                    </local:FZMaterial>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Team">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                        <Grid>
                            <local:FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                            <DockPanel>
                                <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Score}" DockPanel.Dock="Left" Visibility="{Binding ShowScore, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                                <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                    <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}"/>
                                </local:FZMaterial>
                                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                    <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                    <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                </StackPanel>
                            </DockPanel>
                        </Grid>
                    </local:FZMaterial>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_CoopShowcase">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_SplitTimeTranslator}">
                            <local:FZMaterial x:Name="SplitMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTimeDark}" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" >
                                <Grid>
                                    <local:FZMaterial x:Name="SplitMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                    <local:FZTextBlock Text="{Binding Split}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
                                </Grid>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                            <Grid>
                                <local:FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                <DockPanel>
                                    <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                        <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}"/>
                                    </local:FZMaterial>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="18,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="SplitMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="SplitMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_King">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_IconTranslator}">
                            <local:FZMaterial x:Name="IconContainerMaterial" Color="{StaticResource A_Color_King_LocalPlayer}" Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" Visibility="{Binding IsIt, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" >
                                <local:FZMaterial x:Name="CrownIcon" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" Color="{StaticResource H_Color_Primary_Black}"/>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithTime}">
                            <Grid>
                                <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}" Color="{StaticResource A_Color_Transparent}"/>
                                <DockPanel>
                                    <local:FZTextBlock x:Name="ScoreText" Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Time}" DockPanel.Dock ="Left" />
                                    <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock ="Right">
                                        <local:FastTextBlock x:Name="PlaceText" Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}"/>
                                    </local:FZMaterial>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithTime}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="18,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsIt}" Value="True">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_King_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_King_PlaceBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_TeamKing">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_IconTranslator}">
                            <local:FZMaterial x:Name="IconContainerMaterial" Color="{StaticResource A_Color_King_LocalPlayer}" Visibility="{Binding IsIt, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}">
                                <Grid>
                                    <local:FZMaterial x:Name="CrownIcon" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" />
                                    <local:FZMaterial x:Name="BrokenCrownA" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_BurdenedKing_Team1.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" Visibility="Collapsed"/>
                                    <local:FZMaterial x:Name="BrokenCrownB" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_BurdenedKing_Team2.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" Visibility="Collapsed"/>
                                </Grid>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}" Color="{StaticResource A_Color_MiniLeaderboard_DarkGlass}" Width="354" >
                            <Grid>
                                <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="334">
                                    <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                    <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                </StackPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding BucketExpired}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="BrokenCrownA" Property="Visibility" Value="Visible" />
                        <Setter TargetName="CrownIcon" Property="Visibility" Value="Collapsed" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_BurdenedKingBackground}" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_BurdenedKingBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding BucketExpired}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="BrokenCrownB" Property="Visibility" Value="Visible" />
                        <Setter TargetName="CrownIcon" Property="Visibility" Value="Collapsed" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_BurdenedKingBackground}" />
                        <Setter TargetName="IconContainerMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_BurdenedKingBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_FlagRush">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_IconTranslator}">
                            <local:FZMaterial x:Name="FlagMaterial" Color="{StaticResource H_Color_Glass_Purple_20pc}" Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" HorizontalAlignment="Left" Visibility="Hidden">
                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_FlagRush.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" />
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                            <Grid>
                                <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}" Color="{StaticResource A_Color_Transparent}"/>
                                <DockPanel>
                                    <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Score}" DockPanel.Dock="Left" />
                                    <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                        <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}"/>
                                    </local:FZMaterial>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="18,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour0}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag0}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag0}" />
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour1}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag1}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag1}" />
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour2}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag2}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag2}" />
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour3}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag3}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag3}" />
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour4}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag4}" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_FlagRush_Flag4}" />
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>

                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_TeamFlagRush">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_IconTranslator}">
                            <!--Use hidden so that timer margins work consistently-->
                            <local:FZMaterial x:Name="FlagMaterial" Color="{StaticResource H_Color_Glass_Purple_20pc}" HorizontalAlignment="Left" Visibility="Hidden" Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}">
                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_FlagRush.png" Width="{StaticResource A_Double_MiniLeaderboard_IconSize}" Height="{StaticResource A_Double_MiniLeaderboard_IconSize}" />
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                            <Grid>
                                <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                <DockPanel>
                                    <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Score}" DockPanel.Dock="Left" />
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="18,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="FlagMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="False"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="False"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour0}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour1}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour2}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour3}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour4}" Value="True">
                        <Setter TargetName="FlagMaterial" Property="Visibility" Value="Visible" />
                    </DataTrigger>

                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <!-- This assumes TeamID 0 = Survivor and TeamID 1 = Infected -->
            <DataTemplate x:Key="A_DataTemplate_ListItem_Infected">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithTime}">
                        <Grid>
                            <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                            <DockPanel>
                                <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Time}"  Visibility="{Binding ShowScore, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" DockPanel.Dock="Left"/>
                                <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                    <local:FZMaterial x:Name="PlaceIcon" Width="32" Height="32" HorizontalAlignment="Center"/>
                                </local:FZMaterial>
                                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithTime}">
                                    <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                    <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                </StackPanel>
                            </DockPanel>
                        </Grid>
                    </local:FZMaterial>
                </Grid>
                    <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsIt}" Value="False">
                        <!--Survivor -->
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Survivor.png" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsIt}" Value="True">
                        <!--Infected -->
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Infected.png" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <!--Player Survivor -->
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <!-- This assumes TeamID 0 = Survivor and TeamID 1 = Infected -->
            <DataTemplate x:Key="A_DataTemplate_ListItem_TeamInfected">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right">
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithTime}">
                            <Grid>
                                <FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                <DockPanel>
                                    <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Time}" DockPanel.Dock="Left"/>
                                    <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                        <local:FZMaterial x:Name="PlaceIcon" Width="32" Height="32" HorizontalAlignment="Center"/>
                                    </local:FZMaterial>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithTime}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Survivor.png" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Contaminated.png" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_Contaminated_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Contaminated_ItemBackground}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsSurvivorTeam}" Value="False">
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Infected.png" />
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_DriftRun">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"  Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowScore, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Width="78">
                            <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                            <DockPanel>
                                <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                    <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}" />
                                </local:FZMaterial>
                                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                    <local:FZTextBlock x:Name="GamertagText" Margin="18,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                    <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                </StackPanel>
                            </DockPanel>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_SplitTime">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_SplitTimeTranslator}">
                            <local:FZMaterial x:Name="SplitMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTime}" Height="Auto" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" >
                                <local:FZTextBlock Text="{Binding Split}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}">
                            <DockPanel>
                                <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                    <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}" />
                                </local:FZMaterial>
                                <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth}">
                                    <local:FZTextBlock x:Name="GamertagText" Margin="12,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                    <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                </StackPanel>
                            </DockPanel>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="SplitMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_TeamSplitTime">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="{StaticResource A_Thickness_LeaderboardItemMargin}">
                    <StackPanel Orientation="Horizontal">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_SplitTimeTranslator}">
                            <local:FZMaterial x:Name="SplitMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_SplitTimeDark}" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" >
                                <Grid>
                                    <FZMaterial x:Name="SplitBackground" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                    <local:FZTextBlock Text="{Binding Split}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="8,0"/>
                                </Grid>
                            </local:FZMaterial>
                        </local:FZMaterial>
                        <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithScore}">
                            <Grid>
                                <local:FZMaterial x:Name="MainMaterialBackgroundColor" Style="{StaticResource A_Style_FZMaterial_PillBackgroundColor}"/>
                                <DockPanel>
                                    <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZText_MiniLeaderboard_Score}" Visibility="{Binding ShowScore, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                                    <local:FZMaterial x:Name="PlaceMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboard_Place}" DockPanel.Dock="Right">
                                        <local:FastTextBlock Text="{Binding Place, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}" Style="{StaticResource A_Style_FastTextBlock_MiniLeaderboard_Place}" HorizontalAlignment="Center" VerticalAlignment="Center" />
                                    </local:FZMaterial>
                                    <StackPanel HorizontalAlignment="Left" Orientation="Horizontal" MaxWidth="{StaticResource A_Double_MiniLeaderboard_TextWidth_WithScore}">
                                        <local:FZTextBlock x:Name="GamertagText" Margin="14,0,0,0" Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}"/>
                                        <local:FZMaterial Margin="2,0,0,0" Style="{StaticResource H_Style_FZMaterial_Adornment_Default}" Tag="{Binding UserProfile.BadgeId}" />
                                    </StackPanel>
                                </DockPanel>
                            </Grid>
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="SplitBackground" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="MainMaterialBackgroundColor" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="SplitBackground" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_MiniLeaderboard_LocalPlayerItem}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <local:MappingConverter x:Key="A_MappingConverter_HUDMiniLeaderboardDisplayMode_TemplateSelectionTriggersTitle" Default="{StaticResource A_ControlTemplate_ContentControl_Invisible}">
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.E3}" Value="{StaticResource A_ControlTemplate_ContentControl_Default}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamStreetRace}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamP2PRace}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamRace}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamScoresWithPosition}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Infected}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamKing}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamKingScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamInfected}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamInfectedScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamFlagRush}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamFlagRushScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Party}" Value="{StaticResource A_ControlTemplate_ContentControl_PartyCount}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Session}" Value="{StaticResource A_ControlTemplate_ContentControl_SessionCount}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.StuntParty}" Value="{StaticResource A_ControlTemplate_ContentControl_StuntPartyCount}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.HorizonStory}" Value="{StaticResource A_ControlTemplate_ContentControl_HorizonStoryCount}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Job}" Value="{StaticResource A_ControlTemplate_ContentControl_JobCount}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.DriftRun}" Value="{StaticResource A_ControlTemplate_ContentControl_Default}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamSplitTime}" Value="{StaticResource A_ControlTemplate_ContentControl_TeamScores}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Touge}" Value="{StaticResource A_ControlTemplate_ContentControl_Default}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.StarScoringRace}" Value="{StaticResource A_ControlTemplate_ContentControl_StarScoring_Tile}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.StarScoringRacePvP}" Value="{StaticResource A_ControlTemplate_ContentControl_Default}" />
            </local:MappingConverter>
            
            <!-- These Styles determine which templates are used on the minileaderboard. -->
            <Style x:Key="A_Style_ContentControl_TemplateSelectionTriggersTitle" TargetType="ContentControl">
                <Setter Property="Template" Value="{Binding DisplayMode, Converter={StaticResource A_MappingConverter_HUDMiniLeaderboardDisplayMode_TemplateSelectionTriggersTitle}}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowOnlyPlayerPosition}" Value="True">
                        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_ContentControl_Default}"/>
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsTeamRace}" Value="True"/>
                            <Condition Binding="{Binding TeamDisplayMode}" Value="{x:Static local:XAMLNerdTeamDisplayMode.TeamVsTime}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding DisplayMode}" Value="{x:Static local:MiniLeaderboardDisplayMode.TeamSplitTime}"/>
                            <Condition Binding="{Binding TeamScores.AnyTeamMembersStillInGame}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <local:MappingConverter x:Key="A_MappingConverter_HUDMiniLeaderboardDisplayMode_TemplateSelectionTriggersList" Default="{StaticResource A_DataTemplate_ListItem_Default}">
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.E3}" Value="{StaticResource A_DataTemplate_ListItem_Invisible}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamStreetRace}" Value="{StaticResource A_DataTemplate_ListItem_Team}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamP2PRace}" Value="{StaticResource A_DataTemplate_ListItem_Team}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamRace}" Value="{StaticResource A_DataTemplate_ListItem_Team}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.CoopShowcase}" Value="{StaticResource A_DataTemplate_ListItem_CoopShowcase}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.King}" Value="{StaticResource A_DataTemplate_ListItem_King}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Infected}" Value="{StaticResource A_DataTemplate_ListItem_Infected}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.FlagRush}" Value="{StaticResource A_DataTemplate_ListItem_FlagRush}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamKing}" Value="{StaticResource A_DataTemplate_ListItem_TeamKing}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamInfected}" Value="{StaticResource A_DataTemplate_ListItem_TeamInfected}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamFlagRush}" Value="{StaticResource A_DataTemplate_ListItem_TeamFlagRush}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Party}" Value="{StaticResource A_DataTemplate_ListItem_Party}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Session}" Value="{StaticResource A_DataTemplate_ListItem_Party}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.StuntParty}" Value="{StaticResource A_DataTemplate_ListItem_Party}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.HorizonStory}" Value="{StaticResource A_DataTemplate_ListItem_HorizonStory}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Job}" Value="{StaticResource A_DataTemplate_ListItem_HorizonStory}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.DriftRun}" Value="{StaticResource A_DataTemplate_ListItem_DriftRun}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.SplitTime}" Value="{StaticResource A_DataTemplate_ListItem_SplitTime}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.TeamSplitTime}" Value="{StaticResource A_DataTemplate_ListItem_TeamSplitTime}" />
                <local:MappingConverterEntry Key="{x:Static local:MiniLeaderboardDisplayMode.Touge}" Value="{StaticResource A_DataTemplate_ListItem_Invisible}" />
            </local:MappingConverter>

            <Style x:Key="A_Style_FrameworkElement_HideIfSinglePlayer" TargetType="FrameworkElement" >
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShouldHideIfOnlyLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding Items.Count}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Hidden"/>
                    </MultiDataTrigger>
                    <!-- In offline races Items.Count is always 0, so we must check ParticipantCount to determine if the position indicator should be hidden -->
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShouldHideIfOnlyLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding ShowOnlyPlayerPosition}" Value="True"/>
                            <Condition Binding="{Binding ParticipantCount}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Hidden"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShouldHideIfOnlyOnePopulatedTeam}" Value="True"/>
                            <Condition Binding="{Binding ShowOnlyPlayerPosition}" Value="True"/>
                            <Condition Binding="{Binding PopulatedTeamCount}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Hidden"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ListBox_TemplateSelectionTriggersList"
                   TargetType="local:CommonListBox"
                   BasedOn="{StaticResource A_Style_FrameworkElement_HideIfSinglePlayer}">
                <Setter Property="ItemTemplate" Value="{Binding DisplayMode, Converter={StaticResource A_MappingConverter_HUDMiniLeaderboardDisplayMode_TemplateSelectionTriggersList}}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowOnlyPlayerPosition}" Value="{StaticResource A_Boolean_True}">
                        <Setter Property="Visibility" Value="Collapsed" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsTeamRace}" Value="True"/>
                            <Condition Binding="{Binding TeamDisplayMode}" Value="{x:Static local:XAMLNerdTeamDisplayMode.TeamVsTime}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <local:LinearTransformConverter Add="1"
                                            Scale="-1"
                                            x:Key="A_InvertConverter" />

            <ControlTemplate x:Key="A_ControlTemplate_BurdenedKingTimer" TargetType="Control">
                <Grid Visibility="{Binding PlayerBucketExpiryTimeRemaining, Converter={StaticResource A_StringVisConverter}}">
                    <Grid HorizontalAlignment="Right">
                        <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Background}" Preset="{FZMaterialPresetGlass BlurAmount=Medium}"/>

                        <DockPanel Width="{Binding ActualWidth, ElementName=SizeHelper}">
                            <Grid DockPanel.Dock="Right"
                                            Width="{Binding ActualWidth, ElementName=SizeHelper}">
                                <Grid.LayoutTransform>
                                    <ScaleTransform x:Name="LeftScaleKing"
                                                            ScaleX="{Binding PlayerBucketExpiryRatio}" />
                                </Grid.LayoutTransform>
                            </Grid>
                            <Grid ClipToBounds="True">
                                <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_BurdenedKingTimer_Bar}" 
                                                            HorizontalAlignment="Left"
                                                            Width="{Binding ActualWidth, ElementName=SizeHelper}"/>
                            </Grid>
                        </DockPanel>
                        <local:FastTextBlock x:Name="Countdown" Text="{Binding PlayerBucketExpiryTimeRemaining}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}"FontFamily="Horizon_B" FontSize="25" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
                    </Grid>

                    <DockPanel Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}">
                        <local:FZMaterial Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" Margin="0,0,-0.5,0" Color="{StaticResource A_Color_MiniLeaderboard_BurdenedKingTimer_Background}" DockPanel.Dock="Left">
                            <local:FZMaterial x:Name="TimerIcon" Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/KingTimer.png" Color="{StaticResource H_Color_Primary_Black}"/>
                        </local:FZMaterial>
                        <Grid x:Name="SizeHelperKing" />
                    </DockPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding PlayerBucketExpiryRatio}" Value="1">
                        <Setter TargetName="TimerIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/BurdenedKingTimer.png"/>
                        <Setter TargetName="TimerIcon" Property="Margin" Value="-5"/>
                        <Setter TargetName="Countdown" Property="Text" Value="{local:Loc PlaygroundGames.IDS_TeamKing_Burdened}"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </ResourceDictionary>
    </UserControl.Resources>

    <Grid x:Name="PART_LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="PART_Hidden">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="PART_Shown">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Decorator Style="{StaticResource A_Style_FrameworkElement_HideIfSinglePlayer}" HorizontalAlignment="Right" VerticalAlignment="Top">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="0" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="4" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <StackPanel HorizontalAlignment="Right" VerticalAlignment="Top">
                    <ContentControl Style="{StaticResource A_Style_ContentControl_TemplateSelectionTriggersTitle}"/>
                    <local:CommonListBox ItemsSource="{Binding Items}" Background="{x:Null}" BorderBrush="{x:Null}" BorderThickness="0" HorizontalAlignment="Left" Style="{StaticResource A_Style_ListBox_TemplateSelectionTriggersList}" ClipToBounds="True">
                        <local:CommonListBox.Template>
                            <ControlTemplate TargetType="{x:Type local:CommonListBox}">
                                <StackPanel Orientation="Vertical" IsItemsHost="True" HorizontalAlignment="Right"/>
                            </ControlTemplate>
                        </local:CommonListBox.Template>
                        <local:CommonListBox.ItemContainerStyle>
                            <Style TargetType="{x:Type ListBoxItem}">
                                <Setter Property="HorizontalAlignment" Value="Right"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                                            <ContentPresenter DockPanel.Dock="Top" />
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </local:CommonListBox.ItemContainerStyle>
                    </local:CommonListBox>
                </StackPanel>
                <Grid Grid.Row="2" Visibility="{Binding TimeRemaining, Converter={StaticResource A_StringVisConverter}}">
                    <DockPanel Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}">
                        <local:FZMaterial Width="{StaticResource A_Double_HUDMiniLeaderboard_PlaceWidth}" Margin="0,0,-0.5,0" Color="{StaticResource A_Color_MiniLeaderboard_Timer_Background}" DockPanel.Dock="Left">
                            <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Timer_Icon.png" HorizontalAlignment="Center" Color="{StaticResource H_Color_Primary_Black}"/>
                        </local:FZMaterial>
                        <Grid x:Name="SizeHelper" />
                    </DockPanel>

                    <Grid HorizontalAlignment="Right" Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}">
                        <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Background}" Preset="{FZMaterialPresetGlass BlurAmount=Medium}"/>

                        <DockPanel Width="{Binding ActualWidth, ElementName=SizeHelper}">
                            <Grid DockPanel.Dock="Right"
                              Width="{Binding ActualWidth, ElementName=SizeHelper}">
                                <Grid.LayoutTransform>
                                    <ScaleTransform x:Name="LeftScale"
                                                ScaleX="{Binding TimeRatio}" />
                                </Grid.LayoutTransform>
                            </Grid>
                            <Grid ClipToBounds="True">
                                <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Timer_Bar}" 
                                              HorizontalAlignment="Left"
                                              Width="{Binding ActualWidth, ElementName=SizeHelper}"/>
                            </Grid>
                        </DockPanel>
                        <local:FastTextBlock Text="{Binding TimeRemaining}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" FontFamily="Horizon_B" FontSize="25" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
                    </Grid>
                </Grid>
                <Control Grid.Row="4" Template="{StaticResource A_ControlTemplate_BurdenedKingTimer}"/>
            </Grid>
        </Decorator>
    </Grid>
</UserControl>
