<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_UserContentShowroom"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      local:AttachedTileMenu.TileMenuNavigationManager="{local:TileMenuNavigationManager Width=4, Height=3}">

    <Page.Resources>
        <ResourceDictionary>

            <System:Double x:Key="A_CreativeHubTile_Width_Left">398</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Height_Left">68</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Width">360</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Height">212</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Width_With_Spacing_Left">46</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Width_With_Spacing">364</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Height_With_Spacing">216</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Height_With_Spacing_Left">72</System:Double>
            <System:Double x:Key="A_CreativeHubTile_Left_Buttons_Padding">504</System:Double>
            <System:Double x:Key="A_Double_Two">2</System:Double>

            <Color x:Key="A_Color_Following_Heart">#FFFF0088</Color>

            <!-- Keeping the size square, having different aspects causing issues loading the profile pic-->
            <Size x:Key="A_Size_CreativeHub_GamerPicSizeParams">348,348</Size>

            <Style x:Key="A_Style_Left_Button_Background"
                TargetType="{Type local:FZMaterial}"
                BasedOn="{StaticResource H_Style_Tile_Background_NoTexture}">
                <Style.Triggers>
                    <DataTrigger
                Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}"
                Value="{x:Static LockState.Locked}">
                        <Setter
                    Property="IsEnabled"
                    Value="False" />
                    </DataTrigger>
                    <Trigger
                Property="IsEnabled"
                Value="False">
                        <Setter
                    Property="Color"
                    Value="{StaticResource H_Color_Glass_Purple_40pc}" />
                    </Trigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_SharedCount"
                TargetType="{x:Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}"/>
                <Setter Property="CapHeight" Value="42"/>
                <Setter Property="TextAlignment" Value="Left"/>
                <Setter Property="Margin" Value="8,0,0,0"/>
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}"
                        Value="{x:Static LockState.Locked}">
                        <Setter
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_Left_Button_Heading"
                TargetType="{x:Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
                <Setter Property="FontFamily" Value="Horizon_C"/>
                <Setter Property="CapHeight" Value="21"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}" Value="{x:Static LockState.Locked}">
                        <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZMaterial_Left_Button_Icon"
                TargetType="{x:Type local:FZMaterial}">
                <Setter Property="ImageSource" Value="{Binding Icon}"/>
                <Setter Property="HorizontalAlignment" Value="Right"/>
                <Setter Property="Height" Value="40"/>
                <Setter Property="Stretch" Value="UniformToFill" />
                <Style.Triggers>
                    <DataTrigger Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}" Value="{x:Static LockState.Locked}">
                         <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Data_Bound/CreativeHub/locked.png" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_DownloadCount"
                TargetType="{x:Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}"/>
                <Setter Property="FontSize" Value="28"/>
                <Setter Property="TextAlignment" Value="Right"/>
                <Setter Property="Margin" Value="4,0,0,0"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_TileText_CreativeHubTile_Header"
                TargetType="{x:Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_FZTextBlock_TileText}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Black}" />
                <Setter Property="CapHeight" Value="20"/>
                <Setter Property="FontFamily" Value="Horizon_C"/>
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}"
                        Value="{x:Static LockState.Locked}">
                        <Setter
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_RankText_CreativeHubTile"
                TargetType="{x:Type local:FZTextBlock}"
                BasedOn="{StaticResource A_Style_UGC_Text_Style}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}" />
                <Setter Property="CapHeight" Value="18"/>
                <Style.Triggers>
                    <DataTrigger
                        Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}"
                        Value="{x:Static LockState.Locked}">
                        <Setter
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_SharedIcon">
                <local:FZMaterial x:Name="SharedIcon"
                                Style="{StaticResource A_Style_FrameworkElement_UserContent_Base}"
                                ImageSource="{Binding ThreadType, Converter={StaticResource A_Converter_ThreadTypeToAlternateIcon}}"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Bottom"
                                GreedyMeasure="True"
                                Stretch="Uniform"
                                Height="52"
                                Color="{StaticResource H_Color_Primary_Black}"/>
                <ControlTemplate.Triggers>
                    <DataTrigger
                        Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}"
                        Value="{x:Static LockState.Locked}">
                        <Setter
                            TargetName="SharedIcon"
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_RankLevel_CreativeHub">
                <StackPanel Orientation="Horizontal"
                    Style="{StaticResource A_Style_FrameworkElement_UserContent_Base}">
                    <local:FZTextBlock x:Name="RankText" Text="{local:Loc Storefront.IDS_Rank}"
                Style="{StaticResource A_Style_FZTextBlock_RankText_CreativeHubTile}"
                VerticalAlignment="Center"/>
                    <local:FZTextBlock x:Name="RankTextValue" Text="{Binding ThreadValue}"
                Style="{StaticResource A_Style_FZTextBlock_RankText_CreativeHubTile}"
                Margin="5,0,0,0"
                VerticalAlignment="Center"/>
                </StackPanel>
            </ControlTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_IconTile_Tile" 
                             TargetType="{x:Type local:FZButton}">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                      local:UIPageTransitionManager.TransitionIndex="{Binding (local:UIPageTransitionManager.TransitionIndex), RelativeSource={RelativeSource TemplatedParent}}">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileShadow}" />
                    <Grid>
                        <local:FZMaterial Style="{StaticResource A_Style_Left_Button_Background}"
                                          Preset="{StaticResource H_Roundtangle_Outer_2px}"/>
                        <Grid Name="Container" Margin="24,0,12,0">
                            <local:FZTextBlock Text="{Binding Heading}" 
                                               Style="{StaticResource A_Style_FZTextBlock_Left_Button_Heading}"/>
                            <FZMaterial Style="{StaticResource A_Style_FZMaterial_Left_Button_Icon}"/>
                        </Grid>
                    </Grid>
                    <StrokeHighlightControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}"
                        ContentRadius="8"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <Trigger Property="TileMenuNavigationManager.TileState" Value="{x:Static TileState.EnabledNonInteractive}">
                        <Setter TargetName="Container" Property="Visibility" Value="{x:Static Visibility.Hidden}"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <ControlTemplate x:Key="A_ControlTemplate_IconTileWithCount"
                             TargetType="{x:Type local:FZButton}">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition}"
                      local:UIPageTransitionManager.TransitionIndex="{Binding (local:UIPageTransitionManager.TransitionIndex), RelativeSource={RelativeSource TemplatedParent}}" >
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileShadow}" />
                    <Grid Style="{StaticResource A_Style_Grid_MotionBlur}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                        <local:FZMaterial Style="{StaticResource H_Style_Tile_Background_NoTexture}"/>
                        <Grid Margin="24">
                            <StackPanel Orientation="Horizontal"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Bottom">
                                <Control
                                    Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}"
                                    DataContext="{Binding UserProfile, RelativeSource={RelativeSource AncestorType=Page}}"
                                    Template="{StaticResource A_ControlTemplate_SharedIcon}"/>
                                <local:FZTextBlock x:Name="SharedCountText"
                                    Style="{StaticResource A_Style_FZTextBlock_SharedCount}"
                                    Text="{Binding DataContext.SharedCountValue, RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalAlignment ="Bottom"/>
                            </StackPanel>
                            <StackPanel Orientation="Vertical"
                                        HorizontalAlignment="Left"
                                        VerticalAlignment="Top">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileText_CreativeHubTile_Header}"
                                               Text="{Binding DataContext.SharedCountTitle, RelativeSource={RelativeSource TemplatedParent}}"/>
                                <Control Tag="{Binding Tag, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}"
                                     HorizontalAlignment="Left" DataContext="{Binding UserProfile, RelativeSource={RelativeSource AncestorType=Page}}"
                                     Template="{StaticResource A_ControlTemplate_RankLevel_CreativeHub}"
                                     Margin="0,10,0,0"/>
                            </StackPanel>
                            <StackPanel Orientation="Horizontal"
                                        HorizontalAlignment="Right"
                                        VerticalAlignment="Bottom">
                                <local:FZMaterial x:Name="DownloadCountIcon"
                                    ImageSource="/ForzaUI;component/Textures/Data_Bound/CreativeHub/downloads.png"
                                    GreedyMeasure="True"
                                    Stretch="Uniform"
                                    Height="24"
                                    VerticalAlignment="Bottom"
                                    Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
                                <local:FZTextBlock x:Name="DownloadCountText"
                                    Style="{StaticResource A_Style_FZTextBlock_DownloadCount}"
                                    Text="{Binding DataContext.DownloadCountValue, RelativeSource={RelativeSource TemplatedParent}}"
                                    VerticalAlignment="Center"/>
                            </StackPanel>
                        </Grid>
                    </Grid>
                    <StrokeHighlightControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}"
                        ContentRadius="8"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger
                        Binding="{Binding (TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=ContentControl}}"
                        Value="{x:Static LockState.Locked}">
                        <Setter
                            TargetName="DownloadCountIcon"
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                        <Setter
                            TargetName="DownloadCountText"
                            Property="Color"
                            Value="{StaticResource H_Color_Primary_Grey_80pc}" />
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>

            <local:LinearTransformConverter x:Key="A_LinearTransformConverter_CreativeHubTile_XPositionTransform_Left" Scale="{StaticResource A_CreativeHubTile_Width_With_Spacing_Left}"/>
            <local:LinearTransformConverter x:Key="A_LinearTransformConverter_CreativeHubTile_XPositionTransform" Scale="{StaticResource A_CreativeHubTile_Width_With_Spacing}"/>
            <local:LinearTransformConverter x:Key="A_LinearTransformConverter_CreativeHubTile_YPositionTransform" Scale="{StaticResource A_CreativeHubTile_Height_With_Spacing}"/>
            <local:LinearTransformConverter x:Key="A_LinearTransformConverter_CreativeHubTile_YPositionTransform_Left" Scale="{StaticResource A_CreativeHubTile_Height_With_Spacing_Left}"/>

            <Style x:Key="A_Style_Button_CreativeHubTile"
                BasedOn="{StaticResource A_Style_Button_RootTile}"
                TargetType="{x:Type local:FZButton}">
                <Setter Property="Width" Value="{StaticResource A_CreativeHubTile_Width}"/>
                <Setter Property="Height" Value="{StaticResource A_CreativeHubTile_Height}"/>
                <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="1"/>
                <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="1"/>
                <Setter Property="TileMenuNavigationManager.TileState" Value="{Static TileState.Enabled}"/>
                <Setter Property="BindingProxy.A" Value="{Binding Path=(local:TileMenuNavigationManager.GridX) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_CreativeHubTile_XPositionTransform}}"/>
                <Setter Property="Canvas.Left"  Value="{Binding (BindingProxy.A), RelativeSource={RelativeSource Self},Converter={MathOperationConverter Operation=Add}, ConverterParameter={StaticResource A_CreativeHubTile_Width_With_Spacing_Left}}"/>
                <Setter Property="Canvas.Top" Value="{Binding Path=(local:TileMenuNavigationManager.GridY), RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_CreativeHubTile_YPositionTransform}}"/>
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_IconTileWithCount}"/>
            </Style>

            <Style x:Key="A_Style_Button_CreativeHubTile_Left"
                BasedOn="{StaticResource A_Style_Button_CreativeHubTile}"
                TargetType="{x:Type local:FZButton}">
                <Setter Property="TileMenuNavigationManager.LockState" Value="{Binding Command.DeniedCommand, RelativeSource={RelativeSource Self}, Converter={StaticResource H_Converter_DeniedCommandToLockState}}" />
                <Setter Property="Height" Value="{StaticResource A_CreativeHubTile_Height_Left}"/>
                <Setter Property="Width" Value="{StaticResource A_CreativeHubTile_Width_Left}"/>
                <Setter Property="BindingProxy.A" Value="{Binding Path=(BindingProxy.B), RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_CreativeHubTile_YPositionTransform_Left}}"/>
                <Setter Property="Canvas.Top" Value="{Binding (BindingProxy.A), RelativeSource={RelativeSource Self}, Converter={MathOperationConverter Operation=Add}, ConverterParameter={StaticResource A_CreativeHubTile_Left_Buttons_Padding}}"/>
                <Setter Property="Canvas.Left" Value="{Binding Path=(local:TileMenuNavigationManager.GridX) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_CreativeHubTile_XPositionTransform}}"/>
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_IconTile_Tile}"/>
                <Style.Triggers>
                    <DataTrigger Binding="{Binding IsSelf, RelativeSource={RelativeSource AncestorType=Page}}"
                                 Value="True">
                        <Setter Property="TileMenuNavigationManager.TileState"
                                Value="{Static TileState.EnabledNonInteractive}"/>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="A_FZTextBlock_FollowerCount_Markup_PINK" TargetType="local:FZRun">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Pink}"/>
            </Style>

            <MappingConverter x:Key="A_MappingConverter_FollowerCountMarkup" >
                <MappingConverterEntry Key="{NoCase PINK}" Value="{StaticResource A_FZTextBlock_FollowerCount_Markup_PINK}" />
            </MappingConverter>

            <Style x:Key="A_Style_FZTextBlock_FollowerCountTitle"
                BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
                TargetType="{x:Type local:FZTextBlock}">
                <Setter Property="CapHeight" Value="21"/>
                <Setter Property="VerticalAlignment" Value="Center"/>
                <Setter Property="HorizontalAlignment" Value="Center"/>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
                <Setter Property="Text" Value="{Binding FollowerCount}"/>
                <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_FollowerCountMarkup}"/>
            </Style>

            <ControlTemplate x:Key="A_ControlTemplate_UserProfileStrip">
                <Grid>
                    <DockPanel x:Name="Profile_Root"
                               VerticalAlignment="Stretch"
                               Width="{StaticResource A_CreativeHubTile_Width_Left}">
                        <ContentControl x:Name="Description"
                                    Tag="{local:Loc TiledMenus.IDS_UserContentShowroom_Player_Profile}" 
                                    Template="{StaticResource A_ControlTemplate_SidePanel}"
                                    Style="{StaticResource A_Style_ContentControl_Header_Custom}"
                                    DockPanel.Dock="Top"
                                    Margin="0,0,0,2"/>
                        <StackPanel DockPanel.Dock="Bottom">
                            <FZMaterial Height="50"
                                        Color="{StaticResource H_Color_Primary_Black}">
                                <FZTextBlock Text="{Binding FollowerCount}" Style="{StaticResource A_Style_FZTextBlock_FollowerCountTitle}"/>
                            </FZMaterial>
                            <Decorator Height="{Convert {StaticResource A_CreativeHubTile_Height_With_Spacing_Left}, Converter={MathOperationConverter Operation=Multiply}, Parameter={StaticResource A_Double_Two}}"/>
                        </StackPanel>

                        <Grid x:Name="GamerPicContainer">
                            <Grid ClipToBounds="True">
                                <FZMaterial x:Name="GamerPicMaterial"
                                            ShouldWaitForImageSource="False"
                                            HorizontalAlignment="Center"
                                            VerticalAlignment="Top"
                                            Stretch="UniformToFill"
                                            Width="{StaticResource A_CreativeHubTile_Width_Left}"
                                            Preset="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                                            ImageSource="{Binding UserProfile, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_GamerPicConverter}, ConverterParameter={StaticResource A_Size_CreativeHub_GamerPicSizeParams}}"
                                            Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}"/>
                                <FZMaterial Height="57"
                                            VerticalAlignment="Bottom" 
                                            Color="{StaticResource H_Color_Glass_Purple_40pc}">
                                    <FZTextBlock Text="{Binding UserProfile.FormattedGamertag, FallbackValue=-}" Style="{StaticResource A_Style_FZTextBlock_CreatorInfo_Gamertag}" CapHeight="21"/>
                                </FZMaterial>
                            </Grid>
                            <ProgressBar Style="{StaticResource A_Style_ProgressBar_WaitSpinner}"
                                        HorizontalAlignment="Center"
                                        VerticalAlignment="Center"
                                        Visibility="{Binding Downloaded, ElementName=GamerPicMaterial, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"/>
                        </Grid>
                    </DockPanel>
                    <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/CreativeHub/FollowedHeartShadow.png"
                                      Stretch="Uniform"
                                      Height="50"    
                                      Margin="340,72,0,0" 
                                      VerticalAlignment="Top"
                                      Visibility="{Binding IsSelf, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"/>
                    <FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/CreativeHub/FollowedHeart.png"
                                Stretch="Uniform" 
                                Height="46"    
                                Margin="334,70,0,0"  
                                VerticalAlignment="Top"
                                Visibility="{Binding IsSelf, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                        <FZMaterial.Style>
                            <Style TargetType="{x:Type local:FZMaterial}">
                                <Style.Triggers>
                                    <DataTrigger Binding="{Binding IsFollowed}" Value="True">
                                        <Setter Property="Color" Value="{StaticResource A_Color_Following_Heart}"/>
                                    </DataTrigger>
                                </Style.Triggers>
                            </Style>
                        </FZMaterial.Style>
                    </FZMaterial>
                </Grid>
            </ControlTemplate> 
        </ResourceDictionary>
    </Page.Resources>

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

    <Grid>
        <Control Style="{StaticResource A_Style_Control_ScreenBackground}" />

        <local:PlayerBarControl x:Name="PART_TopBar"
                        Style="{StaticResource A_Style_PlayerBarControl}"
                        Visibility="{Binding IsInPauseFlow, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" />
        <ContentControl x:Name="BottomBar"
                        Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="PART_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}">
            <Grid x:Name="PART_LayoutRoot"
                  KeyboardNavigation.DirectionalNavigation="Contained">
                <Grid Style="{StaticResource A_Style_FrameworkElement_ScreenTilt}">
                    <StackPanel Orientation="Vertical"
                                VerticalAlignment="Center"
                                HorizontalAlignment="Center">
                        <Decorator Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}"
                            Margin="0,0,0,0"
                            HorizontalAlignment="Left">
                            <ContentControl Content="{local:Loc ScreenTitles.IDS_UserContentShowroom}"
                                            Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                            Width="{StaticResource A_CreativeHubTile_Width_Left}"/>
                        </Decorator>

                        <Grid>
                            <Control Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" 
                                     HorizontalAlignment="Left" 
                                     Template="{StaticResource A_ControlTemplate_UserProfileStrip}"/>
                            <Grid x:Name="PART_MenuContent"
                                        RenderTransformOrigin="0.5,0.5">
                                <local:AutoSizeCanvas x:Name="PART_SCOPE_Main">
                                    <local:FZButton x:Name="PART_Button_Visit_Houses" 
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile_Left}" 
                                                    BindingProxy.B="0"
                                                    local:TileMenuNavigationManager.GridX="0" 
                                                    local:TileMenuNavigationManager.GridY="0"
                                                    local:TileMenuNavigationManager.GridHeight="2"
                                                    Command="{Binding VisitHousesCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                                        <local:FZButton.DataContext>
                                            <local:TileMenuDataItem Heading="{Loc TiledMenus.IDS_UserContentShowroom_TileText_Visit_Houses}"
                                                                    Icon="/ForzaUI;component/Textures/Data_Bound/CreativeHub/visit_house.png"/>
                                        </local:FZButton.DataContext>
                                    </local:FZButton>
                                    <local:FZButton x:Name="PART_Button_Visit_Estate" 
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile_Left}" 
                                                    BindingProxy.B="1"
                                                    local:TileMenuNavigationManager.GridX="0" 
                                                    local:TileMenuNavigationManager.GridY="2"
                                                    Command="{Binding VisitEstateCommand, RelativeSource={RelativeSource AncestorType=Page}}">
                                        <local:FZButton.DataContext>
                                            <local:TileMenuDataItem Heading="{Loc TiledMenus.IDS_UserContentShowroom_TileText_Visit_Estate}"
                                                                    Icon="/ForzaUI;component/Textures/Data_Bound/CreativeHub/visit_estate.png"/>
                                        </local:FZButton.DataContext>
                                    </local:FZButton>
                                    <local:FZButton x:Name="PART_Button_Blueprint"
                                                    DataContext="{Binding Collection[0]}"
                                                    Tag="{x:Static local:UGCThreadType.Blueprint}"
                                                    local:TileMenuNavigationManager.GridX="2"
                                                    local:TileMenuNavigationManager.GridY="0"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    Command="{Binding BlueprintCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_Livery"
                                                    DataContext="{Binding Collection[1]}"
                                                    Tag="{x:Static local:UGCThreadType.Livery}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="3"
                                                    local:TileMenuNavigationManager.GridY="1"
                                                    Command="{Binding LiveryCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_Tuning"
                                                    DataContext="{Binding Collection[2]}"
                                                    Tag="{x:Static local:UGCThreadType.Tuning}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="3"
                                                    local:TileMenuNavigationManager.GridY="0"
                                                    Command="{Binding TuningCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_Vinyl"
                                                    DataContext="{Binding Collection[3]}"
                                                    Tag="{x:Static local:UGCThreadType.Vinyl}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="3"
                                                    local:TileMenuNavigationManager.GridY="2"
                                                    Command="{Binding VinylCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_Photo"
                                                    DataContext="{Binding Collection[4]}"
                                                    Tag="{x:Static local:UGCThreadType.Photo}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="2"
                                                    local:TileMenuNavigationManager.GridY="2"
                                                    Command="{Binding PhotoCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_CommunityChallenge"
                                                    DataContext="{Binding Collection[5]}"
                                                    Tag="{x:Static local:UGCThreadType.SuperSeven}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="2"
                                                    local:TileMenuNavigationManager.GridY="1"
                                                    Command="{Binding CommunityChallengeCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_PropPrefab"
                                                    DataContext="{Binding Collection[6]}"
                                                    Tag="{x:Static local:UGCThreadType.PropPrefab}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="1" 
                                                    local:TileMenuNavigationManager.GridY="0"
                                                    TileMenuNavigationManager.InitialSelection="True"
                                                    Command="{Binding PropPrefabCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_Estate"
                                                    DataContext="{Binding Collection[7]}"
                                                    Tag="{x:Static local:UGCThreadType.Estate}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="1"
                                                    local:TileMenuNavigationManager.GridY="2"
                                                    Command="{Binding EstateCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                    <local:FZButton x:Name="PART_Button_GarageLayout"
                                                    DataContext="{Binding Collection[8]}"
                                                    Tag="{x:Static local:UGCThreadType.GarageLayout}"
                                                    Style="{StaticResource A_Style_Button_CreativeHubTile}"
                                                    local:TileMenuNavigationManager.GridX="1"
                                                    local:TileMenuNavigationManager.GridY="1"
                                                    Command="{Binding GarageLayoutCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                </local:AutoSizeCanvas>
                            </Grid>
                        </Grid>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</Page>
