<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" 
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    x:Class="ForzaUI.A_LiveryModeSelect"
    mc:Ignorable="d"
    Style="{StaticResource A_Style_Page_Generic}"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <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"
                ShowPainterLevel="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_CarSelect"
                Description="{local:Loc Livery.IDS_TileText_CarSelect}"
                Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/CarSelect.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_FindDesigns"
                Heading="{local:Loc Livery.IDS_TileTitle_FindDesigns}"
                Description="{local:Loc Livery.IDS_TileText_FindDesigns}"
                Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/FindDesigns.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_LoadDesign"
                Heading="{local:Loc Livery.IDS_TileTitle_LoadDesign}"
                Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/MyDesignsEmpty.png"
                FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Designs_Icon.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_PaintCar"
                Description="{local:Loc Livery.IDS_TileText_PaintCar}"
                Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/PaintCar.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_ApplyDecals"
                Heading="{local:Loc Livery.IDS_TileTitle_CreateDesign}"
                Description="{local:Loc Livery.IDS_TileText_CreateDesign}"
                Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/ApplyVinylsImage.png"
                FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/VinylIcon.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_CreateVinylGroup"
                Description="{local:Loc Livery.IDS_TileText_CreateGroup}"
                Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/CreateVinylGroups.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_LoadVinylGroup"
                Description="{local:Loc Livery.IDS_TileText_LoadGroup}"
                Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/MyVinylGroups.png"/>
            <local:TileMenuDataItem x:Key="A_MenuDataItem_ErasePaintDecals"
                Description="{local:Loc Livery.IDS_TileText_EraseDesign}"
                Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/EraseVinyl.png"/>

            <DataTemplate DataType="{x:Type local:SavedFileLivery}">
                <Grid x:Name="Root"
                    Style="{StaticResource A_Style_FrameworkElement_LiveTileItemRoot}">
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/TileBackgrounds/MyDesignsGrid.png"
                        Stretch="Uniform"
                        StretchDirection="DownOnly"
                        Opacity="1"/>
                    <local:FZMaterial x:Name="CarImageMaterial"
                                      ImageSource="{Binding BigThumbnail}" 
                                      Visibility="{Binding BigThumbnail, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"
                                      Stretch="Uniform"
                                      Margin="{StaticResource A_Thickness_FeaturedPaintCarImageMargin}"/>
                    <ContentControl Style="{StaticResource A_Style_ContentControl_TileTitlePanel_NoCorners}">
                        <Grid>
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_FeaturedLiveTileTitle}"
                                local:TextBlockInlineMarkup.Markup="{Binding DataContext.Heading, RelativeSource={RelativeSource AncestorType=Button}}"/>
                            <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_FeaturedLiveTileText}"
                                local:TextBlockInlineMarkup.Markup="{Binding DataContext.Description, RelativeSource={RelativeSource AncestorType=Button}}"/>
                        </Grid>
                    </ContentControl>
                </Grid>
            </DataTemplate>
        </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}" />
        
        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}"
                        x:Name="TopBar" />
        <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>
    
        <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 Livery.IDS_MenuTitle_LiveryMode}"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Painting.png"/>
                    </Decorator>

                    <StackPanel x:Name="PART_MenuContent"
                        RenderTransformOrigin="0.5,0.5"
                        Grid.Row="1">
                        <local:AutoSizeCanvas x:Name="PART_SCOPE_Home">
                            <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_CarSelect"
                                DataContext="{StaticResource A_MenuDataItem_CarSelect}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="13"
                                local:TileMenuNavigationManager.GridY="20"/>
                            <local:FZButton x:Name="PART_Button_FindDesign"
                                DataContext="{StaticResource A_MenuDataItem_FindDesigns}"
                                Style="{StaticResource A_Style_Button_MainImageTile}"
                                local:TileMenuNavigationManager.GridX="22"
                                local:TileMenuNavigationManager.GridY="0"/>
                            <local:MyDesignsLiveTile x:Name="PART_Button_LoadDesign"
                                DataContext="{StaticResource A_MenuDataItem_LoadDesign}"
                                Style="{StaticResource A_Style_Button_FeaturedTile}"
                                local:TileMenuNavigationManager.GridX="22"
                                local:TileMenuNavigationManager.GridY="16"
                                local:TileMenuNavigationManager.GridWidth="21"
                                local:TileMenuNavigationManager.GridHeight="14"/>
                            <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_PaintCar"
                                DataContext="{StaticResource A_MenuDataItem_PaintCar}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="12"/>
                            <local:FZButton x:Name="PART_Button_ApplyDecals"
                                DataContext="{StaticResource A_MenuDataItem_ApplyDecals}"
                                Style="{StaticResource A_Style_Button_ImageTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="0"
                                local:TileMenuNavigationManager.GridWidth="16"
                                local:TileMenuNavigationManager.GridHeight="12"/>
                            <local:FZButton x:Name="PART_Button_CreateVinylGroup"
                                DataContext="{StaticResource A_MenuDataItem_CreateVinylGroup}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="16"/>
                            <local:FZButton x:Name="PART_Button_LoadVinylGroup"
                                DataContext="{StaticResource A_MenuDataItem_LoadVinylGroup}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="20"/>
                            <local:FZButton x:Name="PART_Button_ErasePaintDecals"
                                DataContext="{StaticResource A_MenuDataItem_ErasePaintDecals}"
                                Style="{StaticResource A_Style_Button_IconTile}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="24"/>
                        </local:AutoSizeCanvas>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</Page>
