<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:System="clr-namespace:System;assembly=mscorlib"
                    xmlns:local="clr-namespace:ForzaUI"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Color x:Key="A_Color_Leaderboard_Background_TeamRed">#FFFF6060</Color>
    <Color x:Key="A_Color_Leaderboard_Background_TeamBlue">#FF6060FF</Color>
    <Color x:Key="A_Color_Leaderboard_RowBackground">#FFFFFFFF</Color>
    <Color x:Key="A_Color_DividingLineNoData">#20000000</Color>
    <Color x:Key="A_Color_LeaderboardIcon_Background">#64000000</Color>

    <System:Double x:Key="A_Size_ColumnWidthPopoutIcon">48</System:Double>

    <Thickness x:Key="A_Thickness_LeaderboardRowMargin">0,0,0,3</Thickness>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_Empty" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_Pill_NonInteractive}">
        <Setter Property="Focusable" Value="False" />
        <Setter Property="Height" Value="{StaticResource A_Size_RowHeight}" />
        <Setter Property="Color" Value="{StaticResource A_Color_GlassPanel_NonInteractive}"/>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_Selected" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_HighlightPill}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_FinishedStateBox" TargetType="local:FZMaterial"
       BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}">
        <Setter Property="Color" Value="{StaticResource A_Color_Header_Background}" />
        <Setter Property="Opacity" Value="0.25"/>
        <Setter Property="Width" Value="{StaticResource A_Size_ColumnWidthPopoutIcon}" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="Margin" Value="-51,0,0,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.Finished}">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.DNF}">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.Quit}">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.OpposingTeamDisconnect}">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Team}" Value="0" />
                    <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_TeamA_Background}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Team}" Value="1" />
                    <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_TeamB_Background}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="A_Control_Template_League_Rank_Pill" TargetType="Control">
        <local:FZMaterial Preset="{Binding LeagueRank, Converter={StaticResource A_Converter_League_ID_To_Leaderboard_GradientPreset}}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="38"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>

                <Control Grid.Column="0" Tag="{Binding LeagueRank}" 
                         Width="38" Height="34"
                         Template="{StaticResource A_ControlTemplate_Leaderboard_MiniLeagueIcon}" HorizontalAlignment="Center" VerticalAlignment="Center" />

                <local:FZMaterial Grid.Column="1" Margin="2.5" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerInnerRightOnly}" Color="{Binding LeagueRank, Converter={StaticResource A_Converter_League_ID_To_Leaderboard_TierColor_Dark}}">
                    <Decorator LayoutTransform="{StaticResource A_Transform_Italic}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="6,0,4,0">
                        <local:FZTextBlock x:Name="RatingText" Text="{Binding Rating}" Color="{StaticResource A_Color_White}" FontSize="22" FontFamily="Horizon_A"/>
                    </Decorator>
                </local:FZMaterial>
            </Grid>
        </local:FZMaterial>
        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding LeagueRank}" Value="-1">
                <Setter TargetName="RatingText" Property="Text" Value="-"/>
                <Setter TargetName="RatingText" Property="FontSize" Value="42"/>
                <Setter TargetName="RatingText" Property="Margin" Value="0,-4,-4,0"/>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <Style x:Key="A_Style_Control_AdventureRank_Pill" TargetType="Control">
        <Setter Property="Width" Value="94"/>
        <Setter Property="Height" Value="34"/>
        <Setter Property="Template" Value="{StaticResource A_Control_Template_League_Rank_Pill}"/>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_PostionBox" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_Left}">
        <Setter Property="Color" Value="#3CFFFFFF" />
        <Setter Property="Width" Value="{StaticResource A_Size_ColumnWidthSmall}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                <Setter Property="Preset"
                        Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterLeftOnly}" />
                <Setter Property="Color"
                        Value="#26000000" />
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding IsIt}" Value="True" />
                    <Condition Binding="{Binding ShowKing, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_King_Background}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Team}" Value="0" />
                    <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_TeamA_Background}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Team}" Value="1" />
                    <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_TeamB_Background}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding InOnlineGame}" Value="True" />
                    <Condition Binding="{Binding IsIt}" Value="True" />
                    <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_Infected_Background}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding InOnlineGame}" Value="True" />
                    <Condition Binding="{Binding IsIt}" Value="False" />
                    <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color" Value="{StaticResource A_Color_List_Survivor_Background}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_Leaderboard_PositionBox_Selected" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_AcrylicPanel_Highlight}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}" >
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterRightOnly}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}"  Value="True">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterRightOnly}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}"  Value="True">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterRightOnly}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_TeamA" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_TeamB" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_King" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_Infected" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_LeaderboardRow_Survivor" TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}" >
    </Style>

    <Style x:Key="A_Style_FZMaterial_InstructionPanelBackground" TargetType="local:FZMaterial"
            BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_NonInteractive}">
    </Style>

    <Style x:Key="A_Style_FZMaterial_InstructionPanelBackgroundLast" TargetType="local:FZMaterial"
            BasedOn="{StaticResource A_Style_FZMaterial_GlassPanel_BodyPanel}">
    </Style>

    <Style x:Key="A_Style_FZTextBlock_Loading" TargetType="local:FZTextBlock"
            BasedOn="{StaticResource A_Style_FZTextBlock_LeaderboardRow}">
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="Margin" Value="50,0,0,0" />
    </Style>

    <Style x:Key="A_Style_Run_Markup_1" TargetType="local:FZRun">
        <Setter Property="FontFamily" Value="Horizon_B" />
    </Style>

    <Style x:Key="A_Style_Run_Markup_2" TargetType="local:FZRun">
        <Setter Property="FontFamily" Value="Horizon_A" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_PrestigeIcon_Leaderboard"
           BasedOn="{StaticResource A_Style_FZMaterial_PrestigeIcon}"
           TargetType="{x:Type local:FZMaterial}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="False">
                <Setter Property="Color" Value="#969696" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_PrestigeLevel_Leaderboard"
           BasedOn="{StaticResource A_Style_FZTextBlock_PrestigeLevel}"
           TargetType="{x:Type local:FZTextBlock}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="False">
                <Setter Property="Color" Value="#969696" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_ScrollViewer_Leaderboard" TargetType="ScrollViewer">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>

            <ScrollBar x:Name="PART_VerticalScrollBar"
                       Style="{StaticResource A_Style_ScrollBar_Default}"
                       Grid.Column="0" Grid.Row="1"
                       HorizontalAlignment="Right"
                       Minimum="0"
                       Margin="0,0,10,0"
                       Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}"
                       ViewportSize="{TemplateBinding ScrollViewer.ViewportHeight}"
                       Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                       Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}" />

            <ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                                    Content="{TemplateBinding Content}"
                                    CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
                                    Grid.Row="1"/>
        </Grid>
    </ControlTemplate>

    <Style x:Key="A_Style_ListBoxItem_LeaderboardBase"
           TargetType="ListBoxItem"
           BasedOn="{StaticResource A_Style_ListBoxItem_DriverList}">
        <Setter Property="local:FocusOnMouseOverBehaviour.Self"
                Value="True"/>
        <Setter Property="local:SetSelectedOnMouseOverBehaviour.Self"
                Value="True" />
    </Style>

    <Style x:Key="A_Style_CommonListBox_Leaderboard"
           TargetType="{x:Type local:CommonListBox}">
        <Setter Property="OverridesDefaultStyle"  Value="True" />
        <Setter Property="Background" Value="Transparent" />
        <Setter Property="local:FZScrollViewer.IsAtTop" Value="True" />
        <Setter Property="local:FZScrollViewer.IsAtBottom" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:CommonListBox}">
                    <Decorator ClipToBounds="True" Margin="-30,0">
                        <StackPanel Margin="30,0">
                            <local:FZScrollViewer Template="{StaticResource A_ControlTemplate_ScrollViewer_Leaderboard}"
                                                Focusable="False"
                                                HorizontalScrollBarVisibility="Disabled"
                                                VerticalScrollBarVisibility="Auto"
                                                VerticalAlignment="Stretch"
                                                CanContentScroll="True"
                                                local:FZScrollViewer.IsAtTop="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtTop), Mode=OneWayToSource}"
                                                local:FZScrollViewer.IsAtBottom="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource}"
                                                KeepSelectionOnScreen="True"
                                                Margin="-30,0">
                                <VirtualizingStackPanel Orientation="Vertical"
                                                        VirtualizingStackPanel.VirtualizationMode="Recycling"
                                                        IsItemsHost="True"
                                                        MaxHeight="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=MaxHeight}"
                                                        Margin="30,0"/>
                            </local:FZScrollViewer>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Empty}"
                                                      Margin="0,0,0,3" />
                        </StackPanel>
                    </Decorator>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <local:NumUnitConverter x:Key="A_Converter_NumUnitConverter_Position" MinDigits="2" FractionDigits="0" />

    <ControlTemplate x:Key="A_ControlTemplate_ContentControl_SelectableRow" TargetType="ContentControl">
        <Grid>
            <local:RoutedEventCommand x:Name="SelectRowRoutedEventCommand"
                                      RoutedEvent="UIElement.MouseLeftButtonUp"
                                      Command="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}" />
            <local:FZMaterial x:Name="DropShadow"
                                  Style="{StaticResource A_Style_FZMaterial_TextMenuItemShadow}"
                                  IsHitTestVisible="False"
                                  Visibility="Hidden"/>
            <local:FZMaterial x:Name="RowHighlight"
                              local:RoutedEventCommand.Action="{Binding ElementName=SelectRowRoutedEventCommand}"
                              Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Selected}"
                              Color="#00FFFFFF" />
            <Grid HorizontalAlignment="Stretch">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                <local:FZMaterial x:Name="PositionBox" Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_PostionBox}" Grid.Column="0"/>
                <local:FZMaterial x:Name="RowBackground"
                              local:RoutedEventCommand.Action="{Binding ElementName=SelectRowRoutedEventCommand}"
                              Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}"
                              Grid.Column="1"/>
            </Grid>
            <local:FZMaterial x:Name="FZMaterial_Streak"
                              Style="{StaticResource A_Style_FZMaterial_HighlightShadow}"
                              CaptureSubgraph="False">
                <ContentPresenter VerticalAlignment="Center" />
            </local:FZMaterial>

        </Grid>

        <ControlTemplate.Triggers>
            <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                <Setter TargetName="RowHighlight"
                                Property="Color"
                                Value="#FFFFFFFF" />
                <Setter TargetName="RowBackground"
                        Property="Visibility"
                        Value="Collapsed" />
                <Setter TargetName="FZMaterial_Streak" Property="CaptureSubgraph" Value="True" />
                <Setter Property="Visibility" TargetName="DropShadow" Value="Visible" />
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_LeaderboardItem_Selected}"/>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_LeaderboardItem_Unselected}"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_ContentControl_SelectableRow" TargetType="ContentControl">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_ContentControl_SelectableRow}"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform />
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- Footer Stuff -->
    <ControlTemplate x:Key="A_ControlTemplate_FooterRow_Filter">
        <StackPanel Orientation="Horizontal">
            <local:FZTextBlock Text="{local:Loc Rivals.IDS_Filter}"
                               Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                               FontSize="{StaticResource A_FontSize_Cell}"
                               Color="{StaticResource A_Color_Header_Text}" />
            <local:FZTextBlock Text="{Binding FilterName}"
                               Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                               FontSize="{StaticResource A_FontSize_Cell}"
                               Color="{StaticResource A_Color_Header_Text}" Margin="8, 0, 0, 0" />
        </StackPanel>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_FooterRow_Default" TargetType="Control">
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill}">
            <Grid>
                <ContentControl Style="{StaticResource A_Style_Cell}" Template="{StaticResource A_ControlTemplate_FooterRow_Filter}" Width="Auto" />
                <ContentControl Style="{StaticResource A_Style_Cell}" Template="{StaticResource A_ControlTemplate_FooterRow_TopPosition}" Width="Auto" HorizontalAlignment="Right" />
            </Grid>
        </local:FZMaterial>
    </ControlTemplate>

    <!-- Formatted Position -->
    <!-- E.g. "YOU ARE IN THE TOP 10% OF 100 PLAYERS" -->
    <ControlTemplate x:Key="A_ControlTemplate_FooterRow_TopPosition">
        <StackPanel Orientation="Horizontal">
            <local:FZTextBlock Margin="8, 0, 0, 0"
                               Style="{StaticResource A_Style_FZTextBlock_HorizonB}"
                               FontSize="{StaticResource A_FontSize_Cell}"
                               Color="{StaticResource A_Color_Header_Text}"
                               local:TextBlockInlineMarkup.Markup="{Binding FormattedPosition}"
                               local:TextBlockInlineMarkup.ResourceBaseName="A_Style_Run_Markup_" />
        </StackPanel>
    </ControlTemplate>

    <!-- Cell Templates -->

    <ControlTemplate x:Key="A_ControlTemplate_Cell_Position" TargetType="Control">
        <local:FZTextBlock x:Name="PositionText"
                            Text="{Binding Position, Converter={StaticResource A_Converter_NumUnitConverter_Position}}"
                            Style="{StaticResource A_Style_FZTextBlock_DriverListHeading}" />
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_DriverName">
        <StackPanel Orientation="Horizontal" >
            <Control Style="{Binding XP, Converter={StaticResource A_XPConverter}}"
                     local:BindingProxy.A="{StaticResource A_Style_FZTextBlock_PlayerLevelText_Leaderboard}"
                     Margin="0,0,4,0"
                     Height="32"/>
            <StackPanel VerticalAlignment="Center"
                        Margin="0,0,4,0"
                        Visibility="{Binding XP, Converter={StaticResource A_Converter_PrestigeLevelToVisibilityFromXP}, FallbackValue=Collapsed}">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PrestigeIcon_Leaderboard}" />
                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PrestigeLevel_Leaderboard}"
                                   Text="{Binding XP, Converter={StaticResource A_XPConverter_Prestige}}" />
            </StackPanel>
            <Decorator Width="4" />
            <local:FZTextBlock Text="{Binding UserProfile.FormattedClubTag}" Style="{StaticResource A_Style_FZTextBlock_ClubTag}" Visibility="{Binding UserProfile.FormattedClubTag, Converter={StaticResource A_StringVisConverter}}" VerticalAlignment="Center" Margin="0,0,5,0" />
            <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" VerticalAlignment="Center" />
        </StackPanel>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_GrandmasterTeamName">
        <StackPanel Orientation="Horizontal">
            <local:FZTextBlock Text="{Binding ClubTag}" Style="{StaticResource A_Style_FZTextBlock_ClubTag}" Visibility="{Binding ClubTag, Converter={StaticResource A_StringVisConverter}}" VerticalAlignment="Center" Margin="0,0,5,0" />
            <local:FZTextBlock Text="{Binding ClubName}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" VerticalAlignment="Center" />
        </StackPanel>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_CarName">
        <local:FZTextBlock Text="{Binding CarName}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" VerticalAlignment="Center"/>
    </ControlTemplate>

    <Style x:Key="A_Style_ControlTemplate_Cell_SeriesRank" TargetType="Control" BasedOn="{StaticResource A_Style_Control_AdventureRank_Pill}">
        <Setter Property="Tag" Value="{Binding DataContext.LeagueRank}"/>
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_MemberCount">
        <local:FZTextBlock Text="{Binding Members}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" />
    </ControlTemplate>
    <ControlTemplate x:Key="A_ControlTemplate_Cell_Wins">
        <local:FZTextBlock Text="{Binding Wins}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" />
    </ControlTemplate>
    <ControlTemplate x:Key="A_ControlTemplate_Cell_Losses">
        <local:FZTextBlock Text="{Binding Losses}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" />
    </ControlTemplate>
    
    <ControlTemplate x:Key="A_ControlTemplate_Cell_Time">
        <StackPanel Orientation="Horizontal">
            <local:FZTextBlock Text="{Binding Time}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" VerticalAlignment="Center" />
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_RivalDirtyIconSmall}" Tag="{Binding TimeIsDirty}" VerticalAlignment="Center" />
        </StackPanel>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_Cell_AmbientChallengeScore">
        <local:FZTextBlock Text="{Binding AmbientChallengeScore}" Style="{StaticResource A_Style_FZTextBlock_LeaderboardRow}" />
    </ControlTemplate>

    <Style x:Key="A_Style_MapCustomRenderElement_Leaderboard" BasedOn="{StaticResource A_Style_MapCustomRenderElement_UIMap}" TargetType="local:MapCustomRenderElement"/>

    <Style x:Key="A_Style_FZMaterial_StartingGrid_RaceIcon" TargetType="local:FZMaterial">
        <Setter Property="Width" Value="105"/>
        <Setter Property="Height" Value="105"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.StreetRace}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/StreetRace.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.LapsRace}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Circuit.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.P2P}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/P2P.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.CrossCountry}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Cross_Country.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.CrossCountryCircuit}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Cross_Country_Circuit.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.Scramble}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Scramble.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding CurrentRaceMode}" Value="{x:Static local:RaceMode.TrailRace}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Trail.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowcaseID}" Value="0">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Showcase/Motocross.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowcaseID}" Value="1">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Showcase/Hovercraft.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowcaseID}" Value="2">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Showcase/PartyTank.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowcaseID}" Value="3">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Showcase/AR.png"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding ShowcaseID}" Value="4">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/RaceMode/PreRace/Showcase/Train.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Leaderboard_Participants_Counter_Bar" TargetType="Control">
        <Style.Resources>
            <Style TargetType="{x:Type local:FZRun}" x:Key="A_Style_Run_BOLD">
                <Setter Property="FontFamily" Value="Horizon_A"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_PlayerList_Counter" TargetType="local:FZTextBlock">
                <Setter Property="FontFamily" Value="Horizon_B"/>
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="CapHeight" Value="15"/>
                <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_Run_"/>
            </Style>
        </Style.Resources>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <local:FZMaterial HorizontalAlignment="Stretch" Height="48" Margin="0,6,0,0" Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill}">
                        <local:FZTextBlock HorizontalAlignment="Right" VerticalAlignment="Center" Margin="6,6,20,6" 
                                           Style="{StaticResource A_Style_FZTextBlock_PlayerList_Counter}"
                                           local:MultiStringFormatter.Format="{Binding Source={local:Loc Scoreboard.IDS_Players_X_Of_Y}, Converter={StaticResource A_StringToUpper}}"
                                           local:MultiStringFormatter.Param0="{Binding EventViewModel.Participants.Count, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                           local:MultiStringFormatter.Param1="{Binding EventViewModel.Participants.MaximumParticipants, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}"
                                           local:TextBlockInlineMarkup.Markup="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"/>
                    </local:FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>




    <!-- PLAYER LIST CONTROL -->

    <Style x:Key="A_Style_PlayerListControl_Default" TargetType="local:PlayerListControl">
        <Style.Resources>
            <Style x:Key="A_Style_ColumnDefinition_PositionSpacer" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="0"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowPosDelta, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="0"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="0"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="16"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_PositionBox" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="70"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowPosDelta, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="70"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="70"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="70"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Position" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="70"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_PosDelta" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPosDelta, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="30"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_PlayerIcon" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="50"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_ShowTeam" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False"/>
                            <Condition Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Width" Value="70"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Rank" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowAdventureRank, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="94"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            <Style x:Key="A_Style_ColumnDefinition_Rank_Space" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowAdventureRank, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="16"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Player" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="450"/>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Player_Spacer" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="{StaticResource A_GridLength_Column_Spacer_Width}"/>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Car" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowCar, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="275"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Car_Spacer" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="{StaticResource A_GridLength_Column_Spacer_Width}"/>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Class" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowCarClass, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="217"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Status" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="317"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Status_Spacer" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="{StaticResource A_GridLength_Column_Spacer_Width}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_BestLap" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowBestLap, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="185"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Progress" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowProgress, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="185"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Score" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowScore, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="125"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Points" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowPoints, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="140"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_TotalXP" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowTotalXP, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="200"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Time" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowTime, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="173"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_ColumnDefinition_Voice" TargetType="{x:Type ColumnDefinition}">
                <Setter Property="Width" Value="0"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowVoice, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Width" Value="32"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_PlayerListHeader" TargetType="local:FZTextBlock"  BasedOn="{StaticResource A_Style_FZTextBlock_DriverListHeading}">
                <Setter Property="VerticalAlignment" Value="Center" />
            </Style>

            <Style x:Key="A_Style_FZTextBlock_PlayerList_Base" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_LeaderboardRow}">
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_PlayerList" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_PlayerList_Base}" />

            <Style x:Key="A_Style_FZTextBlock_PlayerList_Position" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_DriverListHeading}">
                <Setter Property="FontFamily" Value="Horizon_D"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_PlayerList_Tag" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_ClubTag}">
                <Setter Property="VerticalAlignment" Value="Center"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_LeaderIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/leader_icon.png"/>
                <Setter Property="Width" Value="22"/>
                <Setter Property="Height" Value="22"/>
                <Setter Property="Visibility" Value="{Binding IsLeader, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <Setter Property="Margin" Value="4,0,-4,0"/>
                <Setter Property="Color" Value="{StaticResource A_Color_DriverListRowText}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter Property="Color"
                        Value="{StaticResource A_Color_LocalPlayer_Text}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
                        <Setter Property="Color"
                        Value="{StaticResource A_Color_HighlightText}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_PartyLeaderIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSourceNoPreload"
                        Value="/ForzaUI;component/Textures/Anthem/Icons/leader_icon.png"/>
                <Setter Property="Width" Value="27"/>
                <Setter Property="Height" Value="27"/>
                <Setter Property="Visibility" Value="{Binding IsPartyLeader, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <Setter Property="Margin" Value="4,0,-4,0"/>
                <Setter Property="Color" Value="{StaticResource A_Color_DriverListRowText}" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsLocalPlayer}" Value="True">
                        <Setter Property="Color"
                        Value="{StaticResource A_Color_LocalPlayer_Text}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
                        <Setter Property="Color"
                        Value="{StaticResource A_Color_HighlightText}" />
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsPartyLeader}"
                         Value="False">
                        <Setter Property="Visibility"
                        Value="Collapsed" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_ScrollViewer_PlayerList" TargetType="ScrollViewer">
                <Grid>
                    <ScrollBar x:Name="PART_VerticalScrollBar"
                       Style="{StaticResource A_Style_ScrollBar_Default}"
                       HorizontalAlignment="Right"
                       Minimum="0"
                       Maximum="{TemplateBinding ScrollViewer.ScrollableHeight}"
                       Margin="0,0,10,3"
                       ViewportSize="{TemplateBinding ScrollViewer.ViewportHeight}"
                       Value="{Binding Path=VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource Mode=TemplatedParent}}"
                       Visibility="{TemplateBinding ScrollViewer.ComputedVerticalScrollBarVisibility}" />
                    <ScrollContentPresenter x:Name="PART_ScrollContentPresenter"
                                    Content="{TemplateBinding Content}"
                                    CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"/>
                </Grid>
            </ControlTemplate>

            <Style x:Key="A_Style_ListBox_List_PlayerList_Default"
                   TargetType="{x:Type local:CommonListBox}">
                <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Contained"/>
                <Setter Property="AllowMouseWheelScrolling" Value="False"/>
                <Setter Property="MaxHeight" Value="612"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type local:CommonListBox}">
                            <local:FZScrollViewer Template="{StaticResource A_ControlTemplate_ScrollViewer_PlayerList}"
                                                Focusable="False"
                                                HorizontalScrollBarVisibility="Disabled"
                                                VerticalScrollBarVisibility="Auto"
                                                VerticalAlignment="Center"
                                                CanContentScroll="True"
                                                local:FZScrollViewer.IsAtTop="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtTop), Mode=OneWayToSource}"
                                                local:FZScrollViewer.IsAtBottom="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource}"
                                                KeepSelectionOnScreen="True" Margin="-78,0,-30,0">
                                <VirtualizingStackPanel IsItemsHost="True" 
                                                        VirtualizingStackPanel.VirtualizationMode="Recycling" 
                                                        Orientation="Vertical" Margin="78,0,30,0"/>
                            </local:FZScrollViewer>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}" Value="{x:Null}" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="IsEnabled"
                                Value="False" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <!--Finished Race indicator-->
            <Style x:Key="A_Style_FZMaterial_FinishedRace" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="Width" Value="48"/>
                <Setter Property="Height" Value="48"/>
                <Setter Property="Visibility" Value="Collapsed"/>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowFinishedStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.Finished}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/Finished_Flag.png"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowFinishedStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.DNF}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/DNF_Flag.png"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowFinishedStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.Quit}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/Quit.png"/>
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowFinishedStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding EventStatus}" Value="{x:Static local:EventStatus.OpposingTeamDisconnect}"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                        <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/Disconnect.png"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <!-- Position Delta Arrows -->
            <Style x:Key="A_Style_PositionArrow" TargetType="{x:Type Control}">
                <Setter Property="Focusable" Value="False" />
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate>
                            <local:FZMaterial Color="{StaticResource A_Color_TextMenu_Text_Default}"
                                              Width="15"
                                              Height="7"
                                              x:Name="ArrowMaterial"
                                              Data="{StaticResource A_Geometry_SpinnerArrow}"
                                              HorizontalAlignment="Left"
                                              RenderTransformOrigin="0.5,0.5">
                                <local:FZMaterial.RenderTransform>
                                    <RotateTransform />
                                </local:FZMaterial.RenderTransform>
                            </local:FZMaterial>

                            <ControlTemplate.Triggers>
                                <!-- PosDelta -1=MovedDown 0=NoChange 1=MovedUp -->
                                <DataTrigger Binding="{Binding PosDelta}"
                                             Value="1">
                                    <Setter TargetName="ArrowMaterial"
                                            Property="RenderTransform">
                                        <Setter.Value>
                                            <RotateTransform Angle="180" />
                                        </Setter.Value>
                                    </Setter>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                                    <Setter TargetName="ArrowMaterial" Property="Color" Value="{StaticResource A_Color_TextMenu_Text_Highlighted}" />
                                </DataTrigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding PosDelta}" Value="0">
                        <Setter Property="Visibility" Value="Hidden"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding ShowPosDelta, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False">
                        <Setter Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_PlayerIcon" TargetType="{x:Type local:FZMaterial}">
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="Visibility" Value="Collapsed"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_KingIcon" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerIcon}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/king_icon.png"/>
                <Setter Property="Width" Value="33"/>
                <Setter Property="Height" Value="31"/>
                <Setter Property="Margin" Value="1,0,0,0"/>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding ShowKing, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_InfectedIcon" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerIcon}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/infected_icon.png"/>
                <Setter Property="Width" Value="27"/>
                <Setter Property="Height" Value="30"/>
                <Setter Property="Margin" Value="3,0,0,0"/>
                <Style.Triggers>
                    <MultiDataTrigger >
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding InOnlineGame}" Value="True" />
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_SurvivorIcon" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerIcon}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/survivor_icon.png"/>
                <Setter Property="Width" Value="23"/>
                <Setter Property="Height" Value="31"/>
                <Setter Property="Margin" Value="6,0,0,0"/>
                <Style.Triggers>
                    <MultiDataTrigger >
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding InOnlineGame}" Value="True" />
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                            <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_TeamIcon" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_PlayerIcon}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Anthem/Icons/Lobby/Player_Car.png"/>
                <Setter Property="Width" Value="33"/>
                <Setter Property="Height" Value="22"/>
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="Margin" Value="1,0,0,0"/>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                            <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False"/>
                            <Condition Binding="{Binding ShowKing, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False"/>
                            <Condition Binding="{Binding ShowFlagRush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="False"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Visibility" Value="Visible"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_Control_VoiceChatIcon_PlayerList" TargetType="{x:Type Control}">
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_VoiceChatIcon}"/>
                <Setter Property="Width" Value="40"/>
                <Setter Property="Height" Value="40"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_IconBackground" TargetType="local:FZMaterial"
                   BasedOn="{StaticResource A_Style_FZMaterial_LeaderboardRow}">
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding ShowKing, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Color" Value="{StaticResource A_Color_List_King_Background}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger >
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding InOnlineGame}" Value="True" />
                            <Condition Binding="{Binding IsIt}" Value="True"/>
                            <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Color" Value="{StaticResource A_Color_List_Infected_Background}" />
                    </MultiDataTrigger>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding InOnlineGame}" Value="True" />
                            <Condition Binding="{Binding IsIt}" Value="False"/>
                            <Condition Binding="{Binding ShowInfected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True"/>
                        </MultiDataTrigger.Conditions>
                        <Setter Property="Color" Value="{StaticResource A_Color_List_Survivor_Background}" />
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_CarClassInformation" TargetType="StackPanel">
                <Setter Property="Visibility" Value="Hidden"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding ShowCarClass, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                        <Setter Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding IsShowcase}" Value="True">
                        <Setter Property="Visibility" Value="Hidden"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <DataTemplate x:Key="A_DataTemplate_PlayerList_Item">
                <Grid Margin="18,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Position}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PlayerIcon}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PosDelta}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_ShowTeam}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PositionSpacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Rank}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Rank_Space}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Player}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Player_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Car}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Car_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Class}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Status}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Status_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_BestLap}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Progress}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Time}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Score}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Points}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_TotalXP}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Voice}"/>
                    </Grid.ColumnDefinitions>

                    <local:FZTextBlock Text="{Binding FinishPos, Converter={StaticResource A_NumUnitConverter_Min2Digits_0dp}}"
                                       Style="{StaticResource A_Style_FZTextBlock_PlayerList_Position}" Grid.Column="0" Margin="6,0,0,0"  HorizontalAlignment="Left"/>

                    <local:FZMaterial Grid.Column="1" Style="{StaticResource A_Style_FZMaterial_KingIcon}"/>
                    <local:FZMaterial Grid.Column="1" Style="{StaticResource A_Style_FZMaterial_InfectedIcon}"/>
                    <local:FZMaterial Grid.Column="1" Style="{StaticResource A_Style_FZMaterial_SurvivorIcon}"/>
                    <local:FZMaterial Grid.Column="1" Style="{StaticResource A_Style_FZMaterial_TeamIcon}"/>

                    <Control Style="{StaticResource A_Style_PositionArrow}" Width="35" Height="35" Grid.Column="2" />

                    <Control Style="{StaticResource A_Style_Control_AdventureRank_Pill}" Grid.Column="5" DataContext="{Binding RankData}" Visibility="{Binding Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />

                    <StackPanel Orientation="Horizontal" Grid.Column="7">
                        <Decorator Visibility="{Binding ShowAdventureRank, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                            <StackPanel Orientation="Horizontal" MinWidth="70" Visibility="{Binding IsWristbandVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                <Control x:Name="XP_Level" Style="{Binding XP, Converter={StaticResource A_XPConverter}}"
                                         local:BindingProxy.A="{StaticResource A_Style_FZTextBlock_PlayerLevelText_Leaderboard}"
                                         Margin="0,0,4,0"
                                         Height="32"/>
                                <Decorator x:Name="Prestige_Level">
                                    <StackPanel VerticalAlignment="Center"
                                        Visibility="{Binding XP, Converter={StaticResource A_Converter_PrestigeLevelToVisibilityFromXP}, FallbackValue=Collapsed}">
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PrestigeIcon_Leaderboard}" />
                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PrestigeLevel_Leaderboard}"
                                                   Text="{Binding XP, Converter={StaticResource A_XPConverter_Prestige}}" />
                                    </StackPanel>
                                </Decorator>
                            </StackPanel>
                        </Decorator>

                        <Viewbox StretchDirection="DownOnly" Stretch="Uniform" VerticalAlignment="Center" HorizontalAlignment="Left" MaxWidth="335">
                            <StackPanel Orientation="Horizontal">
                                <local:FZTextBlock Text="{Binding UserProfile.FormattedClubTag}" Style="{StaticResource A_Style_FZTextBlock_PlayerList_Tag}" Margin="0,0,8,0" Visibility="{Binding UserProfile.FormattedClubTag, Converter={StaticResource A_StringVisConverter}}"/>
                                <local:FZMaterial x:Name="LeaderIcon" Style="{StaticResource A_Style_FZMaterial_LeaderIcon}" Margin="0,0,8,0"/>
                                <local:FZTextBlock x:Name="PlayerName"
                                    Text="{Binding UserProfile.FormattedGamertag}"
                                    Style="{StaticResource A_Style_FZTextBlock_PlayerList}"
                                    local:ScreenReader.Event="OnChange"
                                    local:ScreenReader.LineType="SelectedItem"
                                    local:ScreenReader.SelectedNumber="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"
                                    local:ScreenReader.SelectedCount="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}, FallbackValue=0}"/>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_PartyIcon}"/>
                                <local:FZMaterial x:Name="PartyLeaderIcon" Style="{StaticResource A_Style_FZMaterial_PartyLeaderIcon}" Margin="0,-2,8,0"/>
                            </StackPanel>
                        </Viewbox>
                    </StackPanel>
                    <local:FZTextBlock Grid.Column="9" Text="{Binding CarName}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>

                    <StackPanel Grid.Column="11"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Center"
                                Style="{StaticResource A_Style_CarClassInformation}"
                                Orientation="Horizontal">
                        <ContentControl Style="{StaticResource A_Style_Control_CarClassBadge_Small_Leaderboard}"
                                        local:BindingProxy.A="{Binding CarPI}"
                                        local:BindingProxy.B="{Binding CarClass}" />
                    </StackPanel>

                    <local:FZTextBlock Grid.Column="12" x:Name="StatusTextBlock" Text="{Binding Status, Converter={StaticResource A_StringToUpper}}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}" local:ManualPassthroughProperty.Input="{Binding Status}" local:ManualPassthroughProperty.Allowed="{StaticResource A_Boolean_False}" local:ScreenReader.Event="OnChange" local:ScreenReader.LineType="ItemDescription" local:ScreenReader.Line="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}}"/>
                    <local:FZTextBlock Grid.Column="14" Text="{Binding BestLap}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <local:FZTextBlock Grid.Column="15" Text="{Binding Progress}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <local:FZTextBlock Grid.Column="16" Text="{Binding Time}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <local:FZTextBlock Grid.Column="17" Text="{Binding Score}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <local:FZTextBlock Grid.Column="18" Text="{Binding Points, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <local:FZTextBlock Grid.Column="19" Text="{Binding Points, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" Style="{StaticResource A_Style_FZTextBlock_PlayerList}"/>
                    <Control Grid.Column="20" Style="{StaticResource A_Style_Control_VoiceChatIcon_PlayerList}" DataContext="{Binding Voice}" Visibility="{Binding ShowVoice, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                </Grid>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}" Value="True">
                        <Setter TargetName="PlayerName" Property="local:ScreenReader.Line" Value="{Binding UserProfile.FormattedGamertag}"/>
                        <Setter TargetName="StatusTextBlock" Property="local:ManualPassthroughProperty.Allowed" Value="{Binding ShowStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}, FallbackValue={StaticResource A_Boolean_False}}"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <Style x:Key="A_Style_ListBoxItem_PlayerList" TargetType="{x:Type ListBoxItem}">
                <Setter Property="FocusVisualStyle" Value="{x:Null}" />
                <Setter Property="Tag" Value="{StaticResource A_Color_SubHeader_Text}"/>
                <Setter Property="local:FocusOnMouseOverBehaviour.Self"
                        Value="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=local:PlayerListControl}}" />
                <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
                <Setter Property="RenderTransform">
                    <Setter.Value>
                        <TransformGroup>
                            <ScaleTransform />
                            <SkewTransform />
                            <RotateTransform />
                            <TranslateTransform />
                        </TransformGroup>
                    </Setter.Value>
                </Setter>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <Grid Height="{StaticResource A_Size_RowHeight}"
                                  Margin="{StaticResource A_Thickness_LeaderboardRowMargin}">
                                <Grid>
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Style="{StaticResource A_Style_ColumnDefinition_PositionBox}"/>
                                        <ColumnDefinition Width="*"/>
                                    </Grid.ColumnDefinitions>

                                    <local:FZMaterial x:Name="DropShadow"
                                  Style="{StaticResource A_Style_FZMaterial_TextMenuItemShadow}"
                                  IsHitTestVisible="False"
                                  Visibility="Hidden"
                                  Grid.ColumnSpan="2"/>

                                    <local:FZMaterial x:Name="FinishStateBox" Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_FinishedStateBox}"
                                                      Visibility="Collapsed">
                                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FinishedRace}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                                    </local:FZMaterial>

                                    <local:FZMaterial x:Name="PositionBox" Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_PostionBox}"
                                                  Grid.Column="0" Visibility="Hidden" />

                                    <local:FZMaterial x:Name="MainContent" Style="{StaticResource A_Style_FZMaterial_LeaderboardRow}"
                                                  Grid.Column="1"/>
                                </Grid>
                                <local:FZMaterial x:Name="RowHighlight"
                                                  local:RoutedEventCommand.Action="{Binding ElementName=SelectRowRoutedEventCommand}"
                                                  Style="{StaticResource A_Style_FZMaterial_LeaderboardRow_Selected}"
                                                  Color="#00FFFFFF">
                                    <local:FZMaterial x:Name="FZMaterial_Streak"
                                                    Style="{StaticResource A_Style_FZMaterial_HighlightShadow}"
                                                    CaptureSubgraph="False">
                                        <ContentPresenter VerticalAlignment="Center"/>
                                    </local:FZMaterial>
                                </local:FZMaterial>
                                <local:RoutedEventCommand x:Name="ClickOnMouseItem"
                                                          RoutedEvent="UIElement.MouseLeftButtonUp"
                                                          Command="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                <local:FZMaterial x:Name="MouseHitHelper"
                                                  Color="#00000000" Grid.ColumnSpan="3"
                                                  local:RoutedEventCommand.Action="{Binding ElementName=ClickOnMouseItem}"/>
                            </Grid>

                            <ControlTemplate.Triggers>
                                <DataTrigger Binding="{Binding ShowPosition, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                                    <Setter TargetName="PositionBox" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ShowPlayerIcon, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                                    <Setter TargetName="PositionBox" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ShowPosDelta, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                                    <Setter TargetName="PositionBox" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ShowTeams, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                                    <Setter TargetName="PositionBox" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                                <DataTrigger Binding="{Binding ShowFinishedStatus, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlayerListControl}}}" Value="True">
                                    <Setter TargetName="FinishStateBox" Property="Visibility" Value="Visible"/>
                                </DataTrigger>
                                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                                    <Setter TargetName="RowHighlight"
                                            Property="Color"
                                            Value="#FFFFFFFF" />
                                    <Setter TargetName="FZMaterial_Streak" Property="CaptureSubgraph" Value="True" />
                                    <Setter Property="Tag" Value="{StaticResource A_Color_SubHeader_Text}"/>
                                    <Setter Property="IsSelected" Value="True" />
                                    <Setter TargetName="PositionBox"
                                            Property="Visibility"
                                            Value="Collapsed" />
                                    <Setter TargetName="MainContent" Property="Style" Value="{StaticResource A_Style_FZMaterial_FlatPanel_HighlightPill}" />
                                    <Setter Property="Visibility" TargetName="DropShadow" Value="Visible" />
                                    <Trigger.EnterActions>
                                        <BeginStoryboard Storyboard="{StaticResource A_Storyboard_LeaderboardItem_Selected}"/>
                                    </Trigger.EnterActions>
                                    <Trigger.ExitActions>
                                        <BeginStoryboard Storyboard="{StaticResource A_Storyboard_LeaderboardItem_Unselected}"/>
                                    </Trigger.ExitActions>
                                </Trigger>
                            </ControlTemplate.Triggers>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_LeaderboardHeaderRow" TargetType="Control">
                <Grid Margin="18,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Position}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PosDelta}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PlayerIcon}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_ShowTeam}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_PositionSpacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Rank}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Rank_Space}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Player}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Player_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Car}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Car_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Class}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Status}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Status_Spacer}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_BestLap}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Progress}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Time}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Score}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Points}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_TotalXP}"/>
                        <ColumnDefinition Style="{DynamicResource A_Style_ColumnDefinition_Voice}"/>
                    </Grid.ColumnDefinitions>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="0" Text="{local:Loc Scoreboard.IDS_Pos}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="7" Text="{local:Loc Scoreboard.IDS_Driver}"/>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="9" Text="{local:Loc Scoreboard.IDS_Car}" Visibility="{Binding EventViewModel.IsShowcase, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="9" Text="{local:Loc Scoreboard.IDS_Vehicle}" Visibility="{Binding EventViewModel.IsShowcase, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="11" Text="{local:Loc Scoreboard.IDS_Class}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="12" Text="{local:Loc Scoreboard.IDS_Status}"/>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="14" Text="{local:Loc Scoreboard.IDS_BestLap}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="15" Text="{local:Loc Scoreboard.IDS_Progress}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="16" Text="{local:Loc Scoreboard.IDS_Time}"/>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="17" Text="{local:Loc Scoreboard.IDS_Points}" />
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="18" Text="{local:Loc Scoreboard.IDS_Points}"/>
                    <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_PlayerListHeader}" Grid.Column="19" Text="{local:Loc Scoreboard.IDS_TotalXP}"/>
                </Grid>
            </ControlTemplate>
        </Style.Resources>

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <StackPanel>
                        <Decorator Style="{StaticResource A_Style_HeaderRow}">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill}">
                                <Control Template="{StaticResource A_ControlTemplate_LeaderboardHeaderRow}"/>
                            </local:FZMaterial>
                        </Decorator>
                        <Decorator Height="622" ClipToBounds="True" Margin="-78,-10,-30,-3">
                            <StackPanel Margin="78,10,30,0">
                                <local:CommonListBox x:Name="PART_PlayerList"
                                                     Style="{StaticResource A_Style_ListBox_List_PlayerList_Default}"
                                                     ItemTemplate="{StaticResource A_DataTemplate_PlayerList_Item}"
                                                     ItemContainerStyle="{StaticResource A_Style_ListBoxItem_PlayerList}"
                                                     ItemsSource="{Binding DataContext, RelativeSource={RelativeSource Self}}"
                                                     Panel.ZIndex="2"
                                                     AlternationCount="10000"/>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                                                  Margin="0,0,0,3" />
                            </StackPanel>
                        </Decorator>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>