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

    <Page.Resources>
        <ResourceDictionary>
            <local:MappingConverter x:Key="A_Converter_SceneEntryToPopupTitleString"
                Default="{local:Loc Clan.IDS_Create_Club_Title}">
                <local:MappingConverterEntry Key="{x:Static local:SceneEntryEnum.PopupCreateTeamClub}" Value="{local:Loc Clan.IDS_Create_Team_Title}"/>
            </local:MappingConverter>

            <local:MappingConverter x:Key="A_Converter_SceneEntryToClubNameLabelString"
                Default="{local:Loc Clan.IDS_Clan_Name}">
                <local:MappingConverterEntry Key="{x:Static local:SceneEntryEnum.PopupCreateTeamClub}" Value="{local:Loc Clan.IDS_Team_Name}"/>
            </local:MappingConverter>

            <local:MappingConverter x:Key="A_Converter_SceneEntryToClubTagLabelString"
                Default="{local:Loc Clan.IDS_Clan_Tag}">
                <local:MappingConverterEntry Key="{x:Static local:SceneEntryEnum.PopupCreateTeamClub}" Value="{local:Loc Clan.IDS_Team_Tag}"/>
            </local:MappingConverter>
        </ResourceDictionary>
    </Page.Resources>

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

    <Grid x:Name="LayoutRoot" Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
        <!-- Background Blur -->
        <local:FZMaterialGlassCapture />
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Popup_Background}"/>

        <!-- Help Button Bar -->
        <ContentControl x:Name="DefaultHelpPanel" Template="{StaticResource A_ControlTemplate_ButtonBar}">
            <ContentControl local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <StackPanel Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                    HorizontalAlignment="Center"
                    VerticalAlignment="Center"
                    Width="{StaticResource A_Double_SettingsBox_Width}">

            <ContentControl Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}"
                            Content="{Binding SceneEnum, Converter={StaticResource A_Converter_SceneEntryToPopupTitleString}}" />
            <ContentControl Style="{StaticResource A_Style_ContentControl_PopupContentBlock}">
                <local:CommonListBox x:Name="CommonListBox_SpinnerContainer"
                                     Style="{StaticResource A_Style_ListBox_TextMenu_Default}"
                                     Focusable="False"
                                     KeyboardNavigation.DirectionalNavigation="Contained">

                    <ListBoxItem Style="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}">
                        <local:SpinnerControl x:Name="PART_SpinnerControl_ClubName"
                                              Label="{Binding SceneEnum, Converter={StaticResource A_Converter_SceneEntryToClubNameLabelString}}"
                                              Style="{StaticResource A_Style_SpinnerControl_Default_InItemsList}"
                                              ItemsSource="{Binding ClubNameOptions}"
                                              SelectedItem="{Binding ClubNameSelectedItem, Mode=TwoWay}"/>
                    </ListBoxItem>
                    
                    <ListBoxItem Style="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}">
                        <local:SpinnerControl x:Name="PART_SpinnerControl_ClubTag"
                                              Label="{Binding SceneEnum, Converter={StaticResource A_Converter_SceneEntryToClubTagLabelString}}"
                                              Style="{StaticResource A_Style_SpinnerControl_Default_InItemsList}"
                                              ItemsSource="{Binding ClubTagOptions}"
                                              SelectedItem="{Binding ClubTagSelectedItem, Mode=TwoWay}"/>
                    </ListBoxItem>

                    <ListBoxItem Style="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}">
                        <local:SpinnerControl x:Name="PART_SpinnerControl_Privacy"
                                              Label="{local:Loc Clan.IDS_Privacy}"
                                              Style="{StaticResource A_Style_SpinnerControl_Default_InItemsList}"
                                              ItemsSource="{Binding PrivacyOptions}"/>
                    </ListBoxItem>

                    <ListBoxItem Style="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}"
                                 Margin="0, 6, 0, 3"
                                 IsEnabled="{Binding CanCreateClub, FallbackValue=False}">
                        <local:FZButton x:Name="PART_Button_Confirm"
                                Content="{local:Loc Clan.IDS_Confirm_Club_Create}"
                                Template="{StaticResource A_ControlTemplate_Button_TextMenu}"
                                Command="{Binding ConfirmCommand}">
                        </local:FZButton>
                    </ListBoxItem>

                </local:CommonListBox>
            </ContentControl>
        </StackPanel>
    </Grid>
</Page>
