<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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"  
      x:Class="ForzaUI.A_SelectUpgradeType"
      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>
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <!-- Bars -->
        <local:PlayerBarControl x:Name="TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel" Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Grid x:Name="LayoutRoot">
            <Border Style="{StaticResource A_Style_Border_ScenePadding_Opus}"
                    Width="auto">
                <Grid>
                    <DockPanel Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                        <ContentControl Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                        Content="{Binding AreaName, Converter={StaticResource A_StringToUpper}}"
                                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Upgrades.png"
                                        MaxWidth="1200"
                                        Margin="0,0,0,12"
                                        HorizontalAlignment="Left"
                                        DockPanel.Dock="Top" />

                        <ContentControl Template="{StaticResource A_Template_ContentControl_SelectorContainer_PageButtons}"
                                        DockPanel.Dock="Bottom"
                                        Margin="0,12,0,-20"
                                        Panel.ZIndex="1">
                            <local:WrapListBox x:Name="PART_ItemList"
                                               Style="{StaticResource A_Style_Carousel_Square_10Item}"
                                               ItemsSource="{Binding Collection}"
                                               SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                               local:RoutedEventCommand.Action="{Binding ElementName=ButtonBarDisableMouseCursorMovement}"
                                               local:RoutedEventCommand.Action2="{Binding ElementName=ButtonBarEnableMouseCursorMovement}" />
                        </ContentControl>

                        <ContentControl Style="{StaticResource A_Style_DockPanel_Basket}"
                                        DockPanel.Dock="Right"/>
                        
                        <ContentControl Template="{StaticResource A_ControlTemplate_SidePanel}"
                                        DockPanel.Dock="Left"
                                        DataContext="{Binding SelectedItem, ElementName=PART_ItemList}"
                                        Width="346"
                                        HorizontalAlignment="Left"
                                        Tag="{Binding Name, Converter={StaticResource A_StringToUpper}}">
                            <Decorator Margin="24">
                                <local:AutoScrollPanel Style="{StaticResource A_Style_AutoScrollPanel_UpgradesDescription}"
                                                       AnimationContext="{Binding Description}" />
                            </Decorator>
                        </ContentControl>
                    </DockPanel>
                </Grid>
            </Border>
        </Grid>
    </Grid>
</Page>
