<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      x:Class="ForzaUI.A_PreRaceChampionshipStandings"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Menu}"/>
    </local:UIPageTransitionManager.TransitionManager>

    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_PlayerListControl_ChampionshipStandings" TargetType="local:PlayerListControl" BasedOn="{StaticResource A_Style_PlayerListControl_Default}">
                <Style.Resources>
                    <Style x:Key="A_Style_ColumnDefinition_Points" TargetType="{x:Type ColumnDefinition}">
                        <Setter Property="Width" Value="80"/>
                    </Style>
                </Style.Resources>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_EventDetails" TargetType="local:FZTextBlock">
                <Setter Property="Color" Value="#FFFFFFFF"/>
                <Setter Property="CapHeight" Value="20"/>
                <Setter Property="FontFamily" Value="Horizon_B"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
            <Style x:Key="A_Style_FZTextBlock_EventDetails2" TargetType="local:FZTextBlock">
                <Setter Property="Color" Value="#FFFFFFFF"/>
                <Setter Property="CapHeight" Value="20"/>
                <Setter Property="FontFamily" Value="Horizon_D"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
            </Style>
            
            <Style
                TargetType="FZMaterial"
                x:Key="A_Style_Container_EventDescriptionTitle">
                <Setter
                    Property="Color"
                    Value="{StaticResource H_Color_Primary_Purple}" />
                <Setter
                    Property="Height"
                    Value="48" />
            </Style>

            <Style
                x:Key="A_Style_ContentControl_Header_Event"
                TargetType="ContentControl">
                <Setter
                    Property="HorizontalContentAlignment"
                    Value="Center" />
                <Setter
                    Property="VerticalContentAlignment"
                    Value="Center" />
                <Setter
                    Property="Template">
                    <Setter.Value>
                        <ControlTemplate
                            TargetType="ContentControl">
                            <FZMaterial
                                Style="{StaticResource A_Style_Container_EventDescriptionTitle}">
                                <ContentPresenter
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                            </FZMaterial>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ResourceDictionary>
    </Page.Resources>

    <Grid x:Name="PART_LayoutRoot">
        <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />
	
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="PART_DefaultHelpPanel"
                            local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
    
        <Border Style="{StaticResource A_Style_Border_ScenePadding}"
                UseLayoutRounding="True">
            <Grid>
                <StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Margin="0,0,0,50">
                    <StackPanel Orientation="Vertical"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center">
                        <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                            <ContentControl x:Name="eventResultsTextBlock"
                                            Content="{local:Loc ScreenTitles.IDS_ChampionshipStandings}"
                                            Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                            local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Leaderboards.png"
                                            Panel.ZIndex="10" 
                                            HorizontalAlignment="Left"/>
                        </Decorator>

                        <StackPanel Orientation="Horizontal" 
                                    Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                            <local:PlayerListControl x:Name="PART_PlayerList"
                                                     DataContext="{Binding EventViewModel.Participants}"
                                                     ShowPosition="False"
                                                     ShowPoints="True"
                                                     ForceSelection="True"
                                                     Panel.ZIndex="2"
                                                     Style="{StaticResource A_Style_PlayerListControl_ChampionshipStandings}"/>
                            <DockPanel Style="{StaticResource A_Style_DockPanel_MultiplayerGrid_InstructionalPanel}">
                                <ContentControl DockPanel.Dock="Top" 
                                                Content="{Binding EventProgress}"
                                                Style="{StaticResource A_Style_ContentControl_DetailsHeader_StartingGrid}"/>
                                <Control Template="{StaticResource A_ControlTemplate_Control_InstructionPanelContent}"/>
                            </DockPanel>
                        </StackPanel>
                    </StackPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</Page>
