<Page DataContext="{Binding RelativeSource={RelativeSource Self}}"
      FlowDirection="LeftToRight"
      Style="{StaticResource A_Style_Page_Generic}"
      mc:Ignorable="d"
      x:Class="ForzaUI.A_ReturnToGame"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      xmlns:local="clr-namespace:ForzaUI;assembly="
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      x:Name="Page">
    <Page.Resources>
        <ResourceDictionary>
            <local:MappingConverter x:Key="A_MappingConverter_ContentControl_BDescription_ColdBootDestination">
                <local:MappingConverterEntry Key="True" Value="{local:Loc HelpButtons.IDS_ColdBoot_EnterHouse}" />
                <local:MappingConverterEntry Key="False" Value="{local:Loc HelpButtons.IDS_ColdBoot_EnterFestival}" />
            </local:MappingConverter>

            <local:MappingConverter x:Key="A_MappingConverter_ContentControl_ScreenTitle_FromIsColdBoot">
                <local:MappingConverterEntry Key="True" Value="{local:Loc ScreenTitles.IDS_ReturnToGameColdBoot}" />
                <local:MappingConverterEntry Key="False" Value="{local:Loc ScreenTitles.IDS_ReturnToGame}" />
            </local:MappingConverter>

             <local:MappingConverter x:Key="A_Season_Main_Brand_Converter">
                <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/ActiveSeason/EN/Main_Spring.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/ActiveSeason/EN/Main_Summer.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/ActiveSeason/EN/Main_Autumn.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/ActiveSeason/EN/Main_Winter.png"/>
             </local:MappingConverter>
            <local:MappingConverter x:Key="A_Season_ComingSoon_Brand_Converter">
                <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SeasonSoon/EN/Spring_ComingSoon.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SeasonSoon/EN/Summer_ComingSoon.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SeasonSoon/EN/Autumn_ComingSoon.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SeasonSoon/EN/Winter_ComingSoon.png"/>
            </local:MappingConverter>
            <local:MappingConverter x:Key="A_Season_Streak_Converter">
                <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SpringStreak.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/SummerStreak.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/AutumnStreak.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/ReturnToGame/WinterStreak.png"/>
             </local:MappingConverter>
            <local:MappingConverter x:Key="A_Season_Video_Converter">
                <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="Media/UI/Videos/TILE_ReturnToGame_Spring.bk2"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="Media/UI/Videos/TILE_ReturnToGame_Summer.bk2"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="Media/UI/Videos/TILE_ReturnToGame_Autumn.bk2"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="Media/UI/Videos/TILE_ReturnToGame_Winter.bk2"/>
             </local:MappingConverter>
            <local:MappingConverter x:Key="A_Season_VideoFirstFrame_Converter">
                <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="/ForzaUI;component/Textures/Data_Bound/VideoTiles/TILE_ReturnToGame_Spring.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="/ForzaUI;component/Textures/Data_Bound/VideoTiles/TILE_ReturnToGame_Summer.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="/ForzaUI;component/Textures/Data_Bound/VideoTiles/TILE_ReturnToGame_Autumn.png"/>
                <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="/ForzaUI;component/Textures/Data_Bound/VideoTiles/TILE_ReturnToGame_Winter.png"/>
             </local:MappingConverter>

            <Style x:Key="A_Style_FZRun_BOLD"
                   TargetType="local:FZRun">
                <Setter Property="FontFamily"
                        Value="Horizon_A" />
            </Style>

            <Style x:Key="A_Style_ContentControl_DefaultButtonBar_ReturnToGame" TargetType="ContentControl" BasedOn="{StaticResource A_Style_ContentControl_DefaultButtonBar}">
                <Setter Property="local:ControllerButtonPanel.ADescription" Value="{local:Loc HelpButtons.IDS_Select}"/>
                <Setter Property="local:ControllerButtonPanel.BDescription" Value="{local:Loc HelpButtons.IDS_Back}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsColdBoot}" Value="True">
                        <Setter Property="local:ControllerButtonPanel.BDescription" Value="{Binding IsDestinationPlayerhouse, Converter={StaticResource A_MappingConverter_ContentControl_BDescription_ColdBootDestination}}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>
            
        </ResourceDictionary>
    </Page.Resources>
    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_TiledRootMenu}" />
    </local:UIPageTransitionManager.TransitionManager>
    <Grid>
        <!-- Background Blur -->
       <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />
        <!-- Bars -->
        <local:PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}"
                        x:Name="TopBar" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <ContentControl Style="{StaticResource A_Style_ContentControl_DefaultButtonBar_ReturnToGame}"
                            x:Name="DefaultHelpPanel" />
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding_TiledScene}">

            <Grid x:Name="LayoutRoot"
                KeyboardNavigation.DirectionalNavigation="Contained"
                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="282,0,0,0"
                           Grid.Row="0">
                    <ContentControl Content="{Binding IsColdBoot, Converter={StaticResource A_MappingConverter_ContentControl_ScreenTitle_FromIsColdBoot}}" Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                    local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/ReturnToGame.png"/>
                </Decorator>

                <StackPanel Grid.Row="1" RenderTransformOrigin="0.5,0.5" x:Name="PART_MenuContent">
                    <local:AutoSizeCanvas x:Name="PART_SCOPE_Home">
                        <local:FZButton Style="{StaticResource A_Style_Button_LargeIconTile}"
                                        local:TileMenuNavigationManager.GridX="9"
                                        local:TileMenuNavigationManager.GridY="16"
                                        Command="{Binding MyHorizonLifeCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc TiledMenus.IDS_ReturnToGame_TileTitle_MyHorizonLife}"
                                                        Description="{local:Loc TiledMenus.IDS_ReturnToGame_TileText_MyHorizonLife}"
                                                        Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Horizon_Life.png"/>
                            </local:FZButton.DataContext>
                        </local:FZButton>
                        <local:VideoTileMenuDataItem x:Name="DataContext_CurrentSeason"
                            Icon="{Binding CurrentSeason, Converter={StaticResource A_Season_VideoFirstFrame_Converter}, RelativeSource={RelativeSource AncestorType=Page}}"
                            MediaPath="{Binding CurrentSeason, Converter={StaticResource A_Season_Video_Converter}, RelativeSource={RelativeSource AncestorType=Page}}" />
                        <local:FZButton Style="{StaticResource A_Style_Button_MainBorderedEdgeOnlyTile}"
                                        local:TileMenuNavigationManager.GridX="22"
                                        local:TileMenuNavigationManager.GridY="0"
                                        x:Name="PART_Button_CurrentSeason"
                                        Command="{Binding CurrentSeasonCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                        DataContext="{Binding ElementName=DataContext_CurrentSeason}"
                                        local:ManualPassthroughProperty.Input="{local:Loc ScreenTitles.IDS_FestivalPass}">
                            <Grid>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableVideoTileBackground_NoCorners}"/>
                                <local:FZMediaElement Style="{StaticResource A_Style_FZMediaElement_Video}"/>
                                <Viewbox Height="50" 
                                         Margin="16"
                                         HorizontalAlignment="Right" 
                                         VerticalAlignment="Top">
                                    <local:NetworkCountdownControl Style="{StaticResource A_Style_EventCountdownControl}"
                                                                   TimerDisplayName="{Binding CurrentSeasonTimerDisplay, RelativeSource={RelativeSource AncestorType=Page}}"
                                                                   GenerateFormattedString="True"
                                                                   CountdownType="SeasonTimeRemaining" />
                                </Viewbox>
                                <Grid VerticalAlignment="Bottom">
                                    <local:FZMaterial x:Name="SeasonStreak" Width="708" Height="375"
                                                      ImageSource="/ForzaUI;component/Textures/Data_Bound/Series7/FestivalPass/Return_To_Game/PurpleStreak.png"/>
                                    <local:FZMaterial x:Name="CurrentSeasonBrand" HorizontalAlignment="Right" VerticalAlignment="Bottom" Stretch="Uniform" Width="424" Height="262"
                                                      ImageSource="/ForzaUI;component/Textures/Data_Bound/Series7/FestivalPass/Return_To_Game/FestivalPassLogo/EN/FestivalPassLogo.png" />
                                </Grid>
                            </Grid>
                        </local:FZButton>
                        <local:TileMenuDataItem x:Name="DataContext_StarCard"
                            Heading="{local:Loc PauseMenu.IDS_TileTitle_StarCard}"
                            Description="{local:Loc PauseMenu.IDS_TileText_StarCard}"
                            FloatingIcon="/ForzaUI;component/Textures/Data_Bound/Series10/StarCard/Pause_Menu/Star_Card.png"
                            Icon="/ForzaUI;component/Textures/Data_Bound/Series10/StarCard/Pause_Menu/Star_Card_Hero.png"/>
                        <local:FZButton x:Name="PART_Button_StarCard"
                            Style="{StaticResource A_Style_Button_ImageTile}"
                            local:TileMenuNavigationManager.GridX="52"
                            local:TileMenuNavigationManager.GridY="0"
                            local:TileMenuNavigationManager.GridWidth="13"
                            local:TileMenuNavigationManager.GridHeight="16"
                            Command="{Binding StarCardCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                            DataContext="{Binding ElementName=DataContext_StarCard}">
                        </local:FZButton>
                        <local:TileMenuDataItem x:Name="DataContext_Forzathon"
                            Heading="{Binding CurrentSeason, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_ForzathonSeasonalHeaderStrings}}"
                            Description="{local:Loc TiledMenus.IDS_ReturnToGame_TileText_Forzathon}"
                            Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/Forzathon_ReturnToGame.png"
                            FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Forzathon.png"/>
                        <local:FZButton Style="{StaticResource A_Style_Button_ImageTile}"
                                        local:TileMenuNavigationManager.GridX="9"
                                        local:TileMenuNavigationManager.GridY="0"
                                        local:TileMenuNavigationManager.GridWidth="13"
                                        local:TileMenuNavigationManager.GridHeight="16"
                                        x:Name="PART_Button_Forzathon"
                                        Command="{Binding ForzathonCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                        DataContext="{Binding ElementName=DataContext_Forzathon}"/>
                        <local:MarketplaceFeaturedLiveTile Style="{StaticResource A_Style_Button_RootTile}"
                                        Template="{StaticResource A_ControlTemplate_FeaturedTile}"
                                        local:ManualPassthroughProperty.Input="{local:Loc PauseMenu.IDS_ScreenReader_GenericFeaturedContent}"
                                        local:TileMenuNavigationManager.GridX="22"
                                        local:TileMenuNavigationManager.GridY="16"
                                        local:TileMenuNavigationManager.GridWidth="21"
                                        local:TileMenuNavigationManager.GridHeight="14"
                                        x:Name="PART_Button_FeaturedMarketplace"
                                        Command="{Binding GoFromFeaturedTileCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <local:MarketplaceFeaturedLiveTile.DataContext>
                                <local:TileMenuDataItem Icon="/ForzaUI;component/Textures/Anthem/TileBackgrounds/FeaturedCar.png"
                                                        FloatingIcon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Featured_Car.png" />
                            </local:MarketplaceFeaturedLiveTile.DataContext>
                        </local:MarketplaceFeaturedLiveTile>

                        <local:InfographicTile Style="{StaticResource A_Style_Infographics_Button}"
                                               local:TileMenuNavigationManager.GridX="43"
                                               local:TileMenuNavigationManager.GridY="16"/>

                        <local:FZButton Style="{StaticResource A_Style_Button_BorderedTile}" x:Name="PART_Button_OnlineAdventure_SeriesRewards"
                                        Command="{Binding SeriesRewardsCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                        local:TileMenuNavigationManager.GridX="52"
                                        local:TileMenuNavigationManager.GridY="16"
                                        local:TileMenuNavigationManager.GridWidth="13"
                                        local:TileMenuNavigationManager.GridHeight="8">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Heading="{local:Loc TiledMenus.IDS_ReturnToGame_TileTitle_OnlineAdventure}"
                                                        Description="{local:Loc TiledMenus.IDS_ReturnToGame_TileText_OnlineAdventure}"
                                                        Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Online_Adventure.png" />
                            </local:FZButton.DataContext>
                            <Grid>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoCornersTinted}"/>
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableLargeIcon}"/>
                                <local:FZMaterial HorizontalAlignment="Right"
                                    VerticalAlignment="Top"
                                    Margin="8"
                                    Style="{StaticResource A_Style_FZMaterial_CarSelectCarouselItem_StatusIconBackground}"
                                    Focusable="False"
                                    Visibility="{Binding NotificationBadgeOnlineAdventureRewards, Converter={StaticResource A_FZBooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=Page}}">
                                    <StackPanel Margin="9,0" VerticalAlignment="Center" Orientation="Horizontal">
                                        <local:FZTextBlock Text="{local:Loc InGame.IDS_New}" 
                                                           Style="{StaticResource A_Style_FZTextBlock_CarSelectCarouseItem_StatusText}" 
                                                           Color="{StaticResource A_Color_CarouselIcon}"
                                                           Margin="0"/>
                                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/NotificationBadges/Reward_Icon.png" 
                                                          Color="{StaticResource A_Color_CarouselIcon}" 
                                                          Width="30"
                                                          Height="30"
                                                          Margin="0,-1,-6,0"/>
                                    </StackPanel>
                                </local:FZMaterial>
                            </Grid>
                        </local:FZButton>
                        <local:FZButton Style="{StaticResource A_Style_Button_IconTile}"
                                Command="{Binding BusinessEarningsCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="24"
                                x:Name="PART_Button_BusinessEarnings">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Description="{local:Loc TiledMenus.IDS_ReturnToGame_TileTitle_BusinessEarnings}"
                                                        Icon="/ForzaUI;component/Textures/Anthem/Icons/PauseMenu/Message_Centre.png" />
                            </local:FZButton.DataContext>
                        </local:FZButton>
                        <!--
                        <local:FZButton Style="{StaticResource A_Style_Button_IconTile}"
                                Command="{Binding PatchNotesCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                                local:TileMenuNavigationManager.GridX="52"
                                local:TileMenuNavigationManager.GridY="24"
                                x:Name="PART_Button_PatchNotes">
                            <local:FZButton.DataContext>
                                <local:TileMenuDataItem Description="{local:Loc TiledMenus.IDS_ReturnToGame_TileTitle_PatchNotes}"
                                                        Icon="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Patch_Notes.png" />
                            </local:FZButton.DataContext>
                        </local:FZButton>
                        -->
                    </local:AutoSizeCanvas>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</Page>
