<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.Scenes.Anthem.A_Upgrades"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      local:AttachedTileMenu.TileMenuNavigationManager="{local:TileMenuNavigationManager}">

    <Page.Resources>
        <ResourceDictionary>
            <Style x:Key="A_Style_FZButton_Tiled_TextMenu_Upgrades" BasedOn="{StaticResource A_Style_FZButton_Tiled_TextMenu}" TargetType="FZButton">
                <Setter Property="Tag" Value="Numeric" />
            </Style>
        </ResourceDictionary>
    </Page.Resources>


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

    <Grid x:Name="PART_LayoutRoot">
        <Control Template="{StaticResource A_ControlTemplate_PatternedBackground}"/>
        <!-- Bars -->
        <local:PlayerBarControl x:Name="PART_TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar"
                        Style="{StaticResource A_Style_ButtonBar}">
            <ControllerButtonPanel x:Name="PART_HelpPanel"
                                 Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <ControllerButtonControl Button="A"
                                               Description="{Loc HelpButtons.IDS_Select}" />
                <ControllerButtonControl Button="B"
                                               Description="{Loc HelpButtons.IDS_Back}" />
            </ControllerButtonPanel>
        </ContentControl>

        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <Grid Style="{StaticResource A_Style_FrameworkElement_TiledMenuTransition_0}">
                <ContentControl Content="{Binding Source={local:Loc ScreenTitles.IDS_Upgrades}}"
                                Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock_Tile_TextMenu}"/>

                <Grid x:Name="PART_MenuContent">
                    <Grid Style="{StaticResource A_Style_Grid_Tiled_TextMenu}"
                                  x:Name="PART_SCOPE_Upgrades">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <local:FZButton Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    x:Name="PART_Button_CustomUpgrade"
                                    TileMenuNavigationManager.InitialSelection="True"
                                    Grid.Row="0"
                                    PropertySetter.Property="{x:Null}"
                                    Command="{Binding GoCustomUpgradeCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                    local:BindingProxy.A="{Binding UpgradesNotificationBadge, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_CustomUpgrade}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_CustomUpgrade}"/>
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton  Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                         x:Name="PART_Button_AutoUpgrade"
                                         Grid.Row="1"
                                         Command="{Binding GoAutoUpgradeCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading ="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_AutoUpgrade}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_AutoUpgrade}" />
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    x:Name="PART_Button_UpgradePresets"
                                    Grid.Row="2"
                                    Command="{Binding GoUpgradePresetCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                    local:BindingProxy.A="{Binding PresetsNotificationBadge, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_UpgradePresets}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_UpgradePresets}" />
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    x:Name="PART_Button_Tuning"
                                    Grid.Row="3"
                                    Command="{Binding GoSelectTuneCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_Tuning}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_Tuning}" />
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    x:Name="PART_Button_LoadSetup"
                                    Grid.Row="4"
                                    Command="{Binding GoLoadSetupsCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_LoadUpgrade}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_LoadUpgrade}" />
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton x:Name="PART_Button_FindUpgrade"
                                    Grid.Row="5"
                                    Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    Command="{Binding GoFindSetupsCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_FindTunes}"
                                                Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_FindTunes}"/>
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton x:Name="PART_Button_FollowedPlayers"
                                    Grid.Row="6"
                                    Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    Command="{Binding GoFollowedPlayerCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc TiledMenus.IDS_TileText_FollowedPlayers}"/>
                            </local:FZButton.DataContext>
                        </local:FZButton>

                        <local:FZButton x:Name="PART_Button_CarMastery"
                                    Grid.Row="7"
                                    Style="{StaticResource A_Style_FZButton_Tiled_TextMenu_Upgrades}"
                                    Command="{Binding GoCarMasteryCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_CarMastery}" />
                            </local:FZButton.DataContext>
                        </local:FZButton>
                    </Grid>
                </Grid>
            </Grid>
        </Grid>
    </Grid>
</Page>
