<UserControl
    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>
            <System:Double x:Key="A_Double_ScaleWinning">1.0</System:Double>
            <System:Double x:Key="A_Double_ScaleTied">1.0</System:Double>
            <System:Double x:Key="A_Double_ScaleLosing">0.68</System:Double>

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

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

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

            <TransformGroup x:Key="A_TransformGroup_Scale">
                <ScaleTransform/>
                <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_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}" />
                <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_HUD_Team_A_ItemBackground}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Tag" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}"/>
                    </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_HUD_Team_B_ItemBackground}"/>
                <Setter Property="RenderTransform" Value="{StaticResource A_TransformGroup_HorizFlip}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="Tag" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}"/>
                    </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="23"/>
                <Setter Property="Margin" Value="12,0"/>
                <Setter Property="FontFamily" Value="Horizon_A"/>
                <Setter Property="Color" Value="{StaticResource A_Color_HUD_Text}" />
                <Setter Property="Effect" Value="{StaticResource A_DropShadowEffect_DefaultHud}" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="40"/>
                <Setter Property="Height" Value="40"/>
            </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"/>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_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"/>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsInfected}" Value="True">
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_Survivor.png"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Color x:Key="A_Color_King_ItemBackground">#66F4CD2A</Color>
            <Color x:Key="A_Color_King_LocalPlayer">#FFF4CD2A</Color>

            <Style x:Key="A_Style_FZTextBlock_MiniLeaderboardText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HudMedium}">
                <Setter Property="MaxWidth" Value="{StaticResource A_Double_HUDMiniLeaderboard_TextWidth}" />
                <Setter Property="Stretch" Value="Uniform" />
                <Setter Property="VerticalAlignment" Value="Center" />
                <Setter Property="Margin" Value="10,0,10,0" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_MiniLeaderboardTextWithPlace" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}">
                <Setter Property="MaxWidth" Value="{StaticResource A_Double_HUDMiniLeaderboard_TextWidthWithPlace}" />
            </Style>

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

            <Style x:Key="A_Style_FZMaterial_MiniLeaderboardRowWithPlace" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_MiniLeaderboardRow}">
                <Setter Property="Width" Value="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}" />
            </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 IsLeader}" Value="False"/>
                            <Condition Binding="{Binding IsConnecting}" Value="False"/>
                            <Condition Binding="{Binding InEvent}" 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_HudMediumLarge_Tight}"
                                       Margin="0,-0.5,15,0"/>
                    <local:FZTextBlock Text="{Binding PlayerPosition}"
                                       Style="{StaticResource A_Style_FZTextBlock_HudVeryLarge_Tight}"/>
                    <local:FZTextBlock Text="/"
                                       Style="{StaticResource A_Style_FZTextBlock_HudVeryLarge_Tight}"/>
                    <local:FZTextBlock Text="{Binding ParticipantCount}"
                                       Style="{StaticResource A_Style_FZTextBlock_HudVeryLarge_Tight}"/>
                </StackPanel>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamScores">
                <Grid Height="40"
                      HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left}" DockPanel.Dock="Left" StretchDirection="Both" Stretch="Fill"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right}" DockPanel.Dock="Right"/>
                        <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_TeamInfectedScores">
                <Grid Height="40"
                      HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_Contaminated.png" DockPanel.Dock="Left" StretchDirection="Both" Stretch="Fill"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/HUDTeamScoreIcons_Survivor.png" DockPanel.Dock="Right"/>
                        <Grid>
                            <Slider Style="{StaticResource A_Style_Slider_TeamScore_Left}" Tag="{StaticResource A_Color_HUD_Team_Contaminated_ItemBackground}"/>
                            <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 Height="40"
                      HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <Grid DockPanel.Dock="Left">
                            <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}" Color="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}"/>
                            <local:FZMaterial GreedyMeasure="True" Stretch="Uniform" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png"/>
                        </Grid>
                        <Grid DockPanel.Dock="Right">
                            <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}" Color="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}"/>
                            <local:FZMaterial GreedyMeasure="True" Stretch="Uniform" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png"/>
                        </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>

            <local:FZMaterialPresetGlassRoundtangle x:Key="A_FZMaterialPresetGlassRoundtangle_GlassPanel_Rounded_Right"
                                                    BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}"
                                                    CornerRadius="{StaticResource A_CornerRadius_Inner_Right}"
                                                    BlurAmount="Medium"/>

            <ControlTemplate x:Key="A_ControlTemplate_ContentControl_TeamFlagRushScores">
                <Grid Height="40"
                      HorizontalAlignment="Stretch"
                      DataContext="{Binding TeamScores}"
                      Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <DockPanel HorizontalAlignment="Stretch">
                        <local:FZMaterial x:Name="TeamLeft" Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Left}" DockPanel.Dock="Left" StretchDirection="Both" Stretch="Fill"/>
                        <local:FZMaterial x:Name="TeamRight" Style="{StaticResource A_Style_FZMaterial_HUDMiniLeaderboard_TeamIcon_Right}" DockPanel.Dock="Right"/>
                        <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="1" Color="#8D000000" 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="LeftBar" Property="local:BindingProxy.A" Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Rounded_Right}"/>
                        <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="RightBar" Property="local:BindingProxy.A" Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Rounded_Right}"/> <!-- this gets flipped, so use right again. -->
                        <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_HUD_PlayerCountBackgroundHighlight}"
                                          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_HUD_PartyListTypeBackground_HorizonStory}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_HUD_PlayerCountBackgroundHighlight}"
                                          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 BucketList.IDS_HorizonStory_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_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 A_Color_HUD_PartyListTypeBackground_Convoy}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_HUD_PlayerCountBackgroundHighlight}"
                                          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 InGame.IDS_GameParty}"
                                               Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                               VerticalAlignment="Center"
                                               HorizontalAlignment="Left"
                                               Margin="10"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" Opacity="1"/>
                        </StackPanel>
                    </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_HUD_ItemBackgroundHighlight}"
                                  Margin="{StaticResource A_Thickness_TemplateSelectionTitleMargin}">
                    <Grid>
                        <local:FZMaterial Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                                          Color="{StaticResource A_Color_HUD_PlayerCountBackgroundHighlight}"
                                          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>
                        <local:FZTextBlock Text="{local:Loc InGame.IDS_Players}"
                                           Style="{StaticResource A_Style_FZTextBlock_HudMedium}"
                                           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_VoiceIcon"
                TargetType="{x:Type local:FZMaterial}">
                <Setter Property="Width" Value="32"/>
                <Setter Property="Height" Value="32"/>
                <Setter Property="Opacity" Value="0"/>
                <Setter Property="Margin" Value="0,0,-32,0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsTalking}" Value="True">
                        <Setter Property="Opacity" Value="1"/>
                        <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Mic.png"/>
                    </DataTrigger>
                </Style.Triggers>
            </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_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="Visibility" Value="Collapsed" />
                <Setter Property="Margin" Value="3,0" />
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLeader}" Value="True"/>
                            <Condition Binding="{Binding IsConnecting}" 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>

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

            <DataTemplate x:Key="A_DataTemplate_ListItem_Default">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Width="101">
                        <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_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_LocalPlayerItem}" />
                        <Setter TargetName="MainMaterial" Property="Style" Value="{StaticResource A_Style_FZMaterial_FlatPanel_Highlight}" />
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Party">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="0,0,0,3">
                    <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_HUD_ItemBackgroundHighlight}"
                                    Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"
                                    HorizontalAlignment="Right">
                        <Grid>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_EventIcon}" HorizontalAlignment="Right"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderIcon}" HorizontalAlignment="Right"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" HorizontalAlignment="Right"/>
                            <ProgressBar Style="{StaticResource A_Style_ProgressBar_WaitSpinner_Connecting}" HorizontalAlignment="Right"/>
                        </Grid>
                    </local:FZMaterial>
                    <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Left" Width="243"/>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}" HorizontalAlignment="Right"/>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="#FFFFFFFF" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_HorizonStory">
                <Grid Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Margin="0,0,0,3">
                    <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_HUD_ItemBackgroundHighlight}"
                                    Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"
                                    HorizontalAlignment="Right">
                        <Grid>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderIcon}" HorizontalAlignment="Right"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon_MiniLeaderboard}" HorizontalAlignment="Right"/>
                        </Grid>
                    </local:FZMaterial>
                    <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" HorizontalAlignment="Left" Width="243"/>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}" HorizontalAlignment="Right"/>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="#FFFFFFFF" />
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_Team">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Width="60" >
                        <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_MiniLeaderboardRowWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_CoopShowcase">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Width="101" >
                        <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_MiniLeaderboardRowWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding TeamID}" Value="1">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_King">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <Canvas>
                        <local:FZMaterial Canvas.Right="0" x:Name="IconContainerMaterial" Preset="{StaticResource A_FZMaterialPresetRoundtangle_HudItem}" Color="{StaticResource A_Color_King_LocalPlayer}"  Margin="0,0,3,0" Visibility="{Binding IsIt, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" >
                            <local:FZMaterial x:Name="CrownIcon" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png" Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        </local:FZMaterial>
                    </Canvas>
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Width="64">
                        <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_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_LocalPlayerItem}" />
                        <Setter TargetName="MainMaterial" Property="Style" Value="{StaticResource A_Style_FZMaterial_FlatPanel_Highlight}" />
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsIt}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_King_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_King_ItemBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_King_LocalPlayer}" />
                    </DataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_King_LocalPlayer}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_King_LocalPlayer}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_ItemBackground}" />
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetGlass_HudItem}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_TeamKing">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <Canvas>
                        <Grid Canvas.Right="0">
                            <local:FZMaterial x:Name="IconContainerMaterial" Preset="{StaticResource A_FZMaterialPresetRoundtangle_HudItem}" Color="{StaticResource A_Color_King_LocalPlayer}" Margin="0,0,3,0" Visibility="{Binding IsIt, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" >
                                <local:FZMaterial x:Name="CrownIcon" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_King.png" Width="36" Height="36" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                            </local:FZMaterial>
                            <local:FZMaterial x:Name="BrokenCrownA" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_BurdenedKing_Team1.png" Width="46" Height="46" Margin="-10,-5,-2,-10" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
                            <local:FZMaterial x:Name="BrokenCrownB" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_BurdenedKing_Team2.png" Width="46" Height="46" Margin="-10,-5,-2,-10" HorizontalAlignment="Center" VerticalAlignment="Center" Visibility="Collapsed"/>
                        </Grid>
                    </Canvas>

                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding TeamID}" Value="0">
                        <Setter TargetName="MainMaterial" 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="MainMaterial" 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="IconContainerMaterial" Property="Visibility" Value="Collapsed" />
                        <Setter TargetName="MainMaterial" 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="IconContainerMaterial" Property="Visibility" Value="Collapsed" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_BurdenedKingBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="1"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_FlagRush">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <Canvas>
                        <local:FZMaterial x:Name="FlagMaterial"
                            Canvas.Right="0"
                            Style="{StaticResource A_Style_FZMaterial_GlassHudItem}"
                            Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                            Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                            Margin="0,0,3,0"
                            Visibility="Hidden">
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_FlagRush.png"
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}"
                                              Width="36" Height="36"/>
                        </local:FZMaterial>
                    </Canvas>
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" HorizontalAlignment="Right" Width="60">
                        <local:FZTextBlock Text="{Binding Score}" Style="{StaticResource A_Style_FZTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Margin="8,0" />
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Place}" Value="1">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_ItemBackgroundHighlight}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_ItemBackgroundHighlight}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="{StaticResource A_Color_HUD_ItemBackgroundHighlight}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_LocalPlayerItem}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="#FFFFFFFF" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsFlagColour0}" Value="True">
                        <Setter TargetName="FlagMaterial" 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="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="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="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="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">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <Canvas>
                        <local:FZMaterial x:Name="FlagMaterial"
                            Canvas.Right="0"
                            Style="{StaticResource A_Style_FZMaterial_GlassHudItem}"
                            Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                            Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}"
                            Margin="0,0,3,0"
                            Visibility="Hidden">
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_FlagRush.png"
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}"
                                              Width="36" Height="36"/>
                        </local:FZMaterial>
                    </Canvas>
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardText}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding TeamID}" Value="0"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_LocalPlayerBackground}" />
                        <Setter TargetName="FlagMaterial" 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="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_A_ItemBackground}" />
                        <Setter TargetName="FlagMaterial" 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="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_LocalPlayerBackground}" />
                        <Setter TargetName="FlagMaterial" 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="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_B_ItemBackground}" />
                        <Setter TargetName="FlagMaterial" 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">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Right" Width="64">
                        <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_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FZMaterial x:Name="PlaceIcon" Width="32" Height="32" HorizontalAlignment="Center"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsIt}" Value="False">
                        <!--Survivor -->
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_ItemBackground}" />
                        <Setter TargetName="MainMaterial" 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="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_ItemBackground}" />
                        <Setter TargetName="MainMaterial" 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"/>
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <!--Player Infected-->
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_LocalPlayerBackground}" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </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">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="MainMaterial" Style="{StaticResource A_Style_FZMaterial_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FZMaterial x:Name="PlaceIcon" Width="32" Height="32" HorizontalAlignment="Center"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <MultiDataTrigger>
                        <!--Player Survivor -->
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="True"/>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="False"/>
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" 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 IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Survivor.png" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Survivor_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="True"/>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Contaminated.png" />
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Contaminated_LocalPlayerBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="True"/>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="False"/>
                            <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="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Contaminated_ItemBackground}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <!--Player Infected-->
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="False"/>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <!--Infected -->
                        <Setter TargetName="MainMaterial" 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" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <!--Player Infected-->
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsSurvivorTeam}" Value="False"/>
                            <Condition Binding="{Binding IsLocalPlayer}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter TargetName="MainMaterial" Property="Color" Value="{StaticResource A_Color_HUD_Team_Infected_LocalPlayerBackground}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                        <Setter TargetName="PlaceIcon" Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/HUD/LeaderboardIcons/Leaderboard_Icon_Infected.png" />
                    </MultiDataTrigger>
                    <DataTrigger Binding="{Binding IsStillInGame}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <DataTemplate x:Key="A_DataTemplate_ListItem_DriftRun">
                <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,0,0,3" Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                    <local:FZMaterial x:Name="ScoreMaterial" Style="{StaticResource A_Style_FZMaterial_GlassHudItem}" Margin="0,0,3,0" Visibility="{Binding ShowSplit, 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_MiniLeaderboardRowWithPlace}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowWidthWithPlace}">
                        <DockPanel>
                            <local:FZMaterial x:Name="PlaceMaterial" Color="{StaticResource A_Color_HUD_ItemBackground}" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"  Height="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" Width="{StaticResource A_Double_HUDMiniLeaderboard_RowHeight}" DockPanel.Dock="Right">
                                <local:FastTextBlock Text="{Binding Place}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,-2,0,0"/>
                            </local:FZMaterial>
                            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_MiniLeaderboardTextWithPlace}" DockPanel.Dock="Left"/>
                        </DockPanel>
                    </local:FZMaterial>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_VoiceIcon}"/>
                </StackPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter TargetName="ScoreMaterial" Property="Color" Value="{StaticResource A_Color_HUD_LocalPlayerItem}" />
                        <Setter TargetName="MainMaterial" Property="Style" Value="{StaticResource A_Style_FZMaterial_FlatPanel_Highlight}" />
                        <Setter TargetName="MainMaterial" Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight_InnerAll}" />
                        <Setter TargetName="PlaceMaterial" Property="Color" Value="#33FFFFFF" />
                    </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_TeamScores}" />
                <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.DriftRun}" 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>
                </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.DriftRun}" Value="{StaticResource A_DataTemplate_ListItem_DriftRun}" />
            </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>
                </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>
                </Style.Triggers>
            </Style>

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

            <Color x:Key="A_Color_MiniLeaderboard_Timer_Background">#FF00B592</Color>
            <Color x:Key="A_Color_MiniLeaderboard_Timer_Bar">#FF1D8F75</Color>
            <Color x:Key="A_Color_MiniLeaderboard_Timer_Bar_Background">#33000000</Color>

            <Color x:Key="A_Color_MiniLeaderboard_BurdenedKingTimer_Background">#FFF4CD2A</Color>
            <Color x:Key="A_Color_MiniLeaderboard_BurdenedKingTimer_Bar">#FFBD9F32</Color>
            <Color x:Key="A_Color_MiniLeaderboard_BurdenedKingTimer_Bar_Background">#33000000</Color>

            <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_BurdenedKingTimer_Bar_Background}" Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_InnerRightOnly}"/>

                        <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}" 
                                                            Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"
                                                            HorizontalAlignment="Left"
                                                            Width="{Binding ActualWidth, ElementName=SizeHelper}"/>
                            </Grid>
                        </DockPanel>
                        <local:FastTextBlock x:Name="Countdown" Text="{Binding PlayerBucketExpiryTimeRemaining}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
                    </Grid>

                    <DockPanel Height="40">
                        <local:FZMaterial Width="40" Margin="0,0,-0.5,0" Color="{StaticResource A_Color_MiniLeaderboard_BurdenedKingTimer_Background}" DockPanel.Dock="Left" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}" >
                            <local:FZMaterial x:Name="TimerIcon" GreedyMeasure="True" ImageSource="/ForzaUI;component/Textures/Anthem/HUD/MiniLeaderboard/KingTimer.png" />
                        </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="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="VisualStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0:0:0.0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="Hide">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
                <VisualState x:Name="Show">
                    <Storyboard>
                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LayoutRoot">
                            <EasingDoubleKeyFrame KeyTime="0" Value="1"/>
                        </DoubleAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
        <Decorator Style="{StaticResource A_Style_FrameworkElement_HideIfSinglePlayer}" HorizontalAlignment="Right" VerticalAlignment="Top">
            <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}">
                    <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/>
                                    </ControlTemplate>
                                </Setter.Value>
                            </Setter>
                        </Style>
                    </local:CommonListBox.ItemContainerStyle>
                </local:CommonListBox>

                <Decorator Height="12"/>

                <Grid Visibility="{Binding TimeRemaining, Converter={StaticResource A_StringVisConverter}}">
                    <DockPanel Height="40">
                        <local:FZMaterial Width="40" Margin="0,0,-0.5,0" Color="{StaticResource A_Color_MiniLeaderboard_Timer_Background}" DockPanel.Dock="Left" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}" >
                            <local:FZMaterial GreedyMeasure="True" ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/Icons/Timer.png" />
                        </local:FZMaterial>
                        <Grid x:Name="SizeHelper" />
                    </DockPanel>

                    <Grid HorizontalAlignment="Right">
                        <local:FZMaterial Color="{StaticResource A_Color_MiniLeaderboard_Timer_Bar_Background}" Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_InnerRightOnly}"/>

                        <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}" 
                                              Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}"
                                              HorizontalAlignment="Left"
                                              Width="{Binding ActualWidth, ElementName=SizeHelper}"/>
                            </Grid>
                        </DockPanel>
                        <local:FastTextBlock Text="{Binding TimeRemaining}" Style="{StaticResource A_Style_FastTextBlock_HudMedium}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0"/>
                    </Grid>
                </Grid>

                <Decorator Height="6"/>

                <Control Template="{StaticResource A_ControlTemplate_BurdenedKingTimer}"/>
            </StackPanel>
        </Decorator>
    </Grid>
</UserControl>
