<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}"
      x:Name="Page">
    
    <Page.Resources>
        <ResourceDictionary>
            <local:ShowroomTileMenuDataItem x:Key="A_MenuDataItem_MyShowroom"
                                    Heading="{local:Loc TiledMenus.IDS_TileTitle_MyShowroom}"
                                    FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Creative_Hub_Icon.png"
                                    ShowTunerLevel="True"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_FollowedPlayers"
                                    Description="{local:Loc TiledMenus.IDS_TileText_FollowedPlayers}"
                                    Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Followed_Players_Alt.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_UpgradePresets"
                                    Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_UpgradePresets}"
                                    Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/UpgradePresets.png" />
            <local:TileMenuDataItem x:Key="A_MenuDataItem_AutoUpgrade"
                                    Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_AutoUpgrade}"
                                    Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/AutoUpgrade.png" />
            <local:TileMenuDataItem x:Key="A_MenuDataItem_FindUpgrade"
                                    Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_FindTunes}"
                                    Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_FindTunes}"
                                    Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/FindTunes.png"
                                    FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Upgrades_and_Tuning.png" />
            <local:TileMenuDataItem x:Key="A_MenuDataItem_LoadUpgrade"
                                    Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_LoadUpgrade}"
                                    Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/LoadUpgrade.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_Tuning"
                                    Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_Tuning}"
                                    Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Tuning.png" />
            <local:TileMenuDataItem x:Key="A_MenuDataItem_CustomUpgrade"
                                    Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_CustomUpgrade}"
                                    Description="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileText_CustomUpgrade}"
                                    Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/CustomUpgrade.png" />
        </ResourceDictionary>
    </Page.Resources>

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

    <Grid>
        <!-- Background Blur -->
       <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <!-- Bars -->
        <local:PlayerBarControl x:Name="TopBar"
                        Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar"
                        Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel"
                            local:ControllerButtonPanel.ADescription="{local:Loc HelpButtons.IDS_Select}"
                            local:ControllerButtonPanel.BDescription="{local:Loc HelpButtons.IDS_Back}"
                            Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>
        
        <!-- Tiles -->
        <Border Style="{StaticResource A_Style_Border_ScenePadding_TiledScene}">
            <Grid x:Name="LayoutRoot"
                  KeyboardNavigation.DirectionalNavigation="Contained"
                  Margin="0,0,0,-25">
                <Grid Style="{StaticResource A_Style_FrameworkElement_ScreenTilt}">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*"/>
                        <RowDefinition Height="{StaticResource A_GridLength_TileMenu_Height}"/>
                    </Grid.RowDefinitions>
                    <Decorator Style="{StaticResource A_Style_FrameworkElement_TiledMenuTransition_1}"
                               HorizontalAlignment="Left"
                               VerticalAlignment="Bottom"
                               Margin="312,0,0,0"
                               Grid.Row="0">
                        <ContentControl Content="{local:Loc ScreenTitles.IDS_Upgrades}"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Upgrades.png"/>
                    </Decorator>

                    <StackPanel x:Name="PART_MenuContent"
                                RenderTransformOrigin="0.5,0.5"
                                Grid.Row="1">
                        <local:AutoSizeCanvas x:Name="PART_SCOPE_Main">
                            <local:FZButton x:Name="PART_Button_MyShowroom"
                                DataContext="{StaticResource A_MenuDataItem_MyShowroom}"
                                Style="{StaticResource A_Style_Button_ShowroomLiveTile}"
                                local:TileMenuNavigationManager.GridX="9"
                                local:TileMenuNavigationManager.GridY="0"/>
                            <local:FZButton x:Name="PART_Button_FollowedPlayers"
                                DataContext="{StaticResource A_MenuDataItem_FollowedPlayers}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="13"
                                local:TileMenuNavigationManager.GridY="16"/>
                            <local:FZButton x:Name="PART_Button_UpgradePresets"
                                DataContext="{StaticResource A_MenuDataItem_UpgradePresets}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="13"
                                local:TileMenuNavigationManager.GridY="20"
                                local:BindingProxy.A="{Binding PresetsNotificationBadge, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}"
/>
                            <local:FZButton x:Name="PART_Button_AutoUpgrade"
                                DataContext="{StaticResource A_MenuDataItem_AutoUpgrade}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="13"
                                local:TileMenuNavigationManager.GridY="24"/>
                            <local:FZButton x:Name="PART_Button_CustomUpgrade"
                                DataContext="{StaticResource A_MenuDataItem_CustomUpgrade}"
                                Style="{StaticResource A_Style_Button_MainImageTile}"
                                local:TileMenuNavigationManager.GridX="22"
                                local:TileMenuNavigationManager.GridY="0"/>
                            <local:TileMenuDataItem x:Name="DataContext_CarMastery"
                                Heading="{local:Loc Upgrades_flow.IDS_UpgradesRoot_TileTitle_CarMastery}"
                                Description="{Binding CarMasteryTileDescription, RelativeSource={RelativeSource AncestorType=Page}}"
                                Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/CarMastery.png"
                                FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Mastery.png"/>
                            <local:FZButton x:Name="PART_Button_CarMastery"
                                DataContext="{Binding ElementName=DataContext_CarMastery}"
                                Style="{StaticResource A_Style_Button_ImageTile}"
                                local:TileMenuNavigationManager.GridX="22"
                                local:TileMenuNavigationManager.GridY="16"
                                local:TileMenuNavigationManager.GridWidth="21"
                                local:TileMenuNavigationManager.GridHeight="14"
                                Command="{Binding GoToCarMasteryCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                            <local:InfographicTile x:Name="PART_Button_Infographic"
                                                   Style="{StaticResource A_Style_Infographics_Button}"
                                                   local:TileMenuNavigationManager.GridX="43"
                                                   local:TileMenuNavigationManager.GridY="16"/>
                            <local:FZButton x:Name="PART_Button_Tuning"
                                DataContext="{StaticResource A_MenuDataItem_Tuning}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="24"/>
                            <local:FZButton x:Name="PART_Button_FindUpgrade"
                                DataContext="{StaticResource A_MenuDataItem_FindUpgrade}"
                                Style="{StaticResource A_Style_Button_ImageTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="0"
                                local:TileMenuNavigationManager.GridWidth="13"
                                local:TileMenuNavigationManager.GridHeight="16"/>
                            <local:MyTunesLiveTile x:Name="PART_Button_LoadUpgrade"
                                DataContext="{StaticResource A_MenuDataItem_LoadUpgrade}"
                                Style="{StaticResource A_Style_Button_LargeIconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="16"
                                local:TileMenuNavigationManager.GridWidth="13"
                                local:TileMenuNavigationManager.GridHeight="8"/>
                        </local:AutoSizeCanvas>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Grid>

</Page>
