<EstateMenu xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
            xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
            x:Class="ForzaUI.A_GarageMenu"
            Style="{StaticResource A_Style_Page_Generic}"
            DataContext="{Binding RelativeSource={RelativeSource Self}}"
            AttachedTileMenu.TileMenuNavigationManager="{TileMenuNavigationManager}">

    <Page.Resources>
        <ResourceDictionary>
            <MappingConverter x:Key="A_Converter_IsEditGarageLocked_To_Tag" Default="Inactive">
                <MappingConverterEntry Key="{x:Null}" Value=""/>
            </MappingConverter>
        </ResourceDictionary>
    </Page.Resources>

    <UIPageTransitionManager.TransitionManager>
        <UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_TiledSubMenu}" />
    </UIPageTransitionManager.TransitionManager>
    <Grid KeyboardNavigation.DirectionalNavigation="Contained"
          x:Name="PART_LayoutRoot">
        <Control Template="{StaticResource A_ControlTemplate_PatternedBackground}"/>
        <!-- Bars -->
        <PlayerBarControl Style="{StaticResource A_Style_PlayerBarControl}"
                        x:Name="TopBar" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <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="{local:Loc DestinationMenu.IDS_BrowseConfigure}"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock_Tile_TextMenu}"/>

                <Decorator
                    x:Name="PART_MenuContent">
                    <Grid
                        Style="{StaticResource A_Style_Grid_Tiled_TextMenu}">
                        <Grid.RowDefinitions>
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                            <RowDefinition />
                        </Grid.RowDefinitions>
                        <FZButton
                            x:Name="PART_EditGarageInfo"
                            Style="{StaticResource A_Style_FZButton_Tiled_TextMenu}"
                            Grid.Row="0"
                            Command="{Binding EditGarageInfoCommand, RelativeSource={RelativeSource AncestorType=Page}}"
                            Tag="{Binding EditGarageInfoCommand.DeniedCommand, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_Converter_IsEditGarageLocked_To_Tag}}">
                            <FZButton.DataContext>
                                <TileMenuDataItem
                                    Heading="{Loc GarageLayout.IDS_GarageMenu_TileTitle_EditGarageInfo}"
                                    Description="{Loc GarageLayout.IDS_GarageMenu_TileText_EditGarageInfo}"/>
                            </FZButton.DataContext>
                        </FZButton>
                        <FZButton
                            x:Name="PART_ManageYourGarages"
                            Style="{StaticResource A_Style_FZButton_Tiled_TextMenu}"
                            Grid.Row="1"
                            Command="{Binding ManageGaragesCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <FZButton.DataContext>
                                <TileMenuDataItem
                                    Heading="{Loc GarageLayout.IDS_GarageMenu_TileTitle_ManageGarages}"
                                    Description="{Loc GarageLayout.IDS_GarageMenu_TileText_ManageGarages}"
                                    Icon="Textures\Data_Bound\Garage\GarageMenu\ManageYourGarages.png" />
                            </FZButton.DataContext>
                        </FZButton>
                        <FZButton
                            x:Name="PART_BrowseCommunityGarages"
                            Style="{StaticResource A_Style_FZButton_Tiled_TextMenu}"
                            Grid.Row="2"
                            Command="{Binding BrowseCommunityGaragesCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <FZButton.DataContext>
                                <TileMenuDataItem
                                    Heading="{Loc GarageLayout.IDS_GarageMenu_TileTitle_BrowseCommunityGarages}"
                                    Description="{Loc GarageLayout.IDS_GarageMenu_TileText_BrowseCommunityGarages}"/>
                            </FZButton.DataContext>
                        </FZButton>
                        <FZButton
                            x:Name="PART_ResetGarage"
                            Style="{StaticResource A_Style_FZButton_Tiled_TextMenu}"
                            Grid.Row="4"
                            Command="{Binding ResetGarageLayoutCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <FZButton.DataContext>
                                <TileMenuDataItem
                                    Heading="{Loc GarageLayout.IDS_GarageMenu_ResetGarage}" />
                            </FZButton.DataContext>
                        </FZButton>
                        <FZButton
                            x:Name="PART_EmptyGarage"
                            Style="{StaticResource A_Style_FZButton_Tiled_TextMenu}"
                            Grid.Row="5"
                            Command="{Binding EmptyGarageLayoutCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                            <FZButton.DataContext>
                                <TileMenuDataItem
                                    Heading="{Loc GarageLayout.IDS_GarageMenu_EmptyGarage}" />
                            </FZButton.DataContext>
                        </FZButton>
                    </Grid>
                </Decorator>
            </Grid>
        </Grid>
    </Grid>
</EstateMenu>
