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

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

    <Page.Resources>
        <System:Double x:Key="A_Double_OnlineAdventureSelect_Tile_Width">572</System:Double>
        <System:Double x:Key="A_Double_OnlineAdventureSelect_Tile_Width_withSpacing">576</System:Double>
        <System:Double x:Key="A_Double_OnlineAdventureSelect_Tile_Height">312</System:Double>
        <System:Double x:Key="A_Double_OnlineAdventureSelect_TileImage_Height">312</System:Double>
        <System:Double x:Key="A_Double_OnlineAdventureSelect_Tile_Height_WithSpacing">316</System:Double>

        <Style x:Key="A_Style_FZRun_HIGHLIGHT" TargetType="local:FZRun">
            <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text_Alternate}" />
        </Style>
        <MappingConverter x:Key="A_MappingConverter_Text_Highlight">
            <MappingConverterEntry Key="{NoCase HIGHLIGHT}" Value="{StaticResource A_Style_FZRun_HIGHLIGHT}" />
        </MappingConverter>
        <Style x:Key="A_Style_FZTextblock_AdventureTile_Description" TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_TileText_Base}">
            <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_Text_Highlight}"/>
        </Style>

        <Size x:Key="A_Size_HorizonOpenLevelTile_GamerPicSizeParams">466,466</Size>

        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToFloatingContentWidth" Default="50">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.Eliminator}" Value="356"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToFloatingContentHeight" Default="50">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.Eliminator}" Value="187"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_CollapsedIfEliminator" Default="{x:Static Visibility.Visible}">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.Eliminator}" Value="{x:Static Visibility.Collapsed}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_ConverterMapping_DefaultTrackAdventureTypeToRaceEventImage">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.RacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.DriftRun}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Drifting.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.Eliminator}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Eliminator.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.SoloCustom}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Custom.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.TougeShowdown}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Touge.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.SpecRacing}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Spec.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.HideSeek}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/HideSeek.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.DriftCustom}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/CustomDrift.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.PlaygroundGamesOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Custom.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_ConverterMapping_ExpansionOneTrackAdventureTypeToRaceEventImage">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.RacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC1/HorizonOpen/MenuTiles/Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.SoloCustom}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC1/HorizonOpen/MenuTiles/Custom.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_ConverterMapping_ExpansionTwoTrackAdventureTypeToRaceEventImage">
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.RacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC2/HorizonOpen/MenuTiles/Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureType.SoloCustom}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC2/HorizonOpen/MenuTiles/Custom.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_TargetTrackToLeaderboardImage" Default="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Leaderboard.png">
            <local:MappingConverterEntry Key="{x:Static local:XAMLTrack.ExpansionOne}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC1/HorizonOpen/MenuTiles/Leaderboard.png"/>
            <local:MappingConverterEntry Key="{x:Static local:XAMLTrack.ExpansionTwo}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC2/HorizonOpen/MenuTiles/Leaderboard.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_IsMaxHorizonOpenLevelToBadgeIcon">
            <local:MappingConverterEntry Key="True" Value="/ForzaUI;component/Textures/Anthem/Icons/Horizon_Open_Badge_Gold.png"/>
            <local:MappingConverterEntry Key="False" Value="/ForzaUI;component/Textures/Anthem/Icons/Horizon_Open_Badge.png"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_IsMaxHorizonOpenLevelToLevelTextColor">
            <local:MappingConverterEntry Key="True" Value="{StaticResource H_Color_Primary_Purple}"/>
            <local:MappingConverterEntry Key="False" Value="{StaticResource H_Color_Primary_White}"/>
        </local:MappingConverter>

        <local:MappingConverter x:Key="A_MappingConverter_IsMaxHorizonOpenLevelToLevelBannerText">
            <local:MappingConverterEntry Key="True" Value="{local:Loc RoadTrip.IDS_HorizonOpen_Level_Max}"/>
            <local:MappingConverterEntry Key="False" Value="{local:Loc RoadTrip.IDS_HorizonOpen_XP_To_Next_Level}"/>
        </local:MappingConverter>

        <DataTemplate DataType="{x:Type local:OnlineAdventureTileDataItem}">
            <Grid Focusable="False">
                <Grid>
                    <local:FZMaterial x:Name="DropShadow" Style="{StaticResource A_Style_FZMaterial_TileDropShadow}" Margin="-28"/>
                    <Grid>
                            <local:FZMaterial x:Name="TileImage"
                                              VerticalAlignment="Top"
                                              Height="{StaticResource A_Double_OnlineAdventureSelect_TileImage_Height}">
                                <local:FZMaterial.Style>
                                    <Style TargetType="FZMaterial"
                                           BasedOn="{StaticResource A_Style_FZMaterial_TileBackground}">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding TargetTrack, RelativeSource={RelativeSource AncestorType=UIPage}}" Value="{x:Static local:XAMLTrack.Default}">
                                                <Setter Property="ImageSource" Value="{Binding AdventureSession, Converter={StaticResource A_ConverterMapping_DefaultTrackAdventureTypeToRaceEventImage}}" />
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding TargetTrack, RelativeSource={RelativeSource AncestorType=UIPage}}" Value="{x:Static local:XAMLTrack.ExpansionOne}">
                                                <Setter Property="ImageSource" Value="{Binding AdventureSession, Converter={StaticResource A_ConverterMapping_ExpansionOneTrackAdventureTypeToRaceEventImage}}" />
                                            </DataTrigger>
                                            <DataTrigger Binding="{Binding TargetTrack, RelativeSource={RelativeSource AncestorType=UIPage}}" Value="{x:Static local:XAMLTrack.ExpansionTwo}">
                                                <Setter Property="ImageSource" Value="{Binding AdventureSession, Converter={StaticResource A_ConverterMapping_ExpansionTwoTrackAdventureTypeToRaceEventImage}}" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </local:FZMaterial.Style>
                                <FZMaterial.Preset>
                                    <FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}" CornerRadius="{CornerRadius TopLeft=8, TopRight=8}" />
                                </FZMaterial.Preset>
                            </local:FZMaterial>

                            <Grid VerticalAlignment="Bottom">
                                <StackPanel Margin="16,0,16,32" VerticalAlignment="Center" HorizontalAlignment="Left">
                                    <local:FZTextBlock x:Name="TileTitle" Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                                                       HorizontalAlignment="Left"
                                                       VerticalAlignment="Top"
                                                       TextWrapping="Wrap"
                                                       TextAlignment="Left"
                                                       CapHeight="35"
                                                       FontFamily="Horizon_C"
                                                       LineAdjust="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToHeadingTextLineAdjust}}"
                                                       Color="{StaticResource H_Color_Primary_White}"
                                                       Text="{Binding Heading}"/>
                                    <Decorator Height="16"/>
                                    <local:FZTextBlock x:Name="TileDescription" Style="{StaticResource A_Style_FZTextblock_AdventureTile_Description}"
                                                       HorizontalAlignment="Left"
                                                       VerticalAlignment="Bottom"
                                                       TextAlignment="Left"
                                                       TextWrapping="Wrap"
                                                       CapHeight="18"
                                                       LineAdjust="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToHeadingTextLineAdjust}}"
                                                       FontFamily="Horizon_B"
                                                       Color="{StaticResource H_Color_Primary_Yellow}"
                                                       Text="{Binding Description}"/>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    <local:FZMaterial Visibility="{Binding UseAlternateColors, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                      Height="16" 
                                      VerticalAlignment="Bottom"
                                      Preset="{Roundtangle CornerRadius={CornerRadius BottomLeft=8, BottomRight=8}}">
                        <local:FZMaterial.Preset>
                            <local:FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_HorizonPlayGradient}"
                                                               CornerRadius="{CornerRadius BottomLeft=8, BottomRight=8}"/>
                        </local:FZMaterial.Preset>
                    </local:FZMaterial>
                </Grid>
            </Grid>
        </DataTemplate>
        
        <DataTemplate DataType="{x:Type local:HorizonOpenLeaderboardTileDataItem}">
            <Grid Focusable="False">
                <local:FZMaterial x:Name="DropShadow" Style="{StaticResource A_Style_FZMaterial_TileDropShadow}" Margin="-28"/>
                <Grid>
                    <local:FZMaterial x:Name="TileImage" Style="{StaticResource A_Style_FZMaterial_TileBackground}"
                                ImageSource="{Binding TargetTrack, RelativeSource={RelativeSource AncestorType=UIPage}, Converter={StaticResource A_MappingConverter_TargetTrackToLeaderboardImage}}"
                                VerticalAlignment="Top" Height="{StaticResource A_Double_OnlineAdventureSelect_TileImage_Height}">
                        <FZMaterial.Preset>
                            <FZMaterialPresetRoundtangle BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}" CornerRadius="{CornerRadius TopLeft=8, TopRight=8}" />
                        </FZMaterial.Preset>
                    </local:FZMaterial>

                    <Grid VerticalAlignment="Bottom">
                        <StackPanel Margin="16,0,16,32" VerticalAlignment="Center" HorizontalAlignment="Left">
                            <local:FZTextBlock x:Name="TileTitle" Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                                               HorizontalAlignment="Left"
                                               VerticalAlignment="Top"
                                               TextWrapping="Wrap"
                                               TextAlignment="Left"
                                               CapHeight="35"
                                               FontFamily="Horizon_C"
                                               LineAdjust="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToHeadingTextLineAdjust}}"
                                               Color="{StaticResource H_Color_Primary_White}"
                                               Text="{local:Loc RoadTrip.IDS_OnlineAdventure_Leaderboard_Title}"/>
                            <Decorator Height="16"/>
                            <local:FZTextBlock x:Name="TileDescription" Style="{StaticResource A_Style_FZTextblock_AdventureTile_Description}"
                                               HorizontalAlignment="Left"
                                               VerticalAlignment="Bottom"
                                               TextAlignment="Left"
                                               TextWrapping="Wrap"
                                               CapHeight="18"
                                               LineAdjust="{Binding LangStr, Source={StaticResource PART_UISceneContext}, Converter={StaticResource A_LangStrToHeadingTextLineAdjust}}"
                                               FontFamily="Horizon_B"
                                               Color="{StaticResource H_Color_Primary_Yellow}"
                                               Text="{local:Loc RoadTrip.IDS_OnlineAdventure_Leaderboard_Description}"/>
                        </StackPanel>
                    </Grid>
                </Grid>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoAlternate}"
                                  Visibility="{Binding UseAlternateColors, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"
                                  Color="#FFFFDE39"
                                  VerticalAlignment="Bottom"
                                  Height="16"
                                  Preset="{Roundtangle CornerRadius={CornerRadius BottomLeft=8, BottomRight=8}}"/>
            </Grid>
        </DataTemplate>

        <ControlTemplate x:Key="A_ControlTemplate_ContentControl_ItemTile" TargetType="ContentControl">
            <ControlTemplate.Resources>
                <Style
                    x:Key="A_Style_Control_MouseRollover_Outer_All_8px"
                    TargetType="{Type Control}"
                    BasedOn="{StaticResource A_Style_Control_MouseRollover_Outer_All}">
                    <Setter Property="DynamicData.Data">
                        <Setter.Value>
                            <DynamicDataSource>
                                <DynamicDataItem Name="MouseRolloverCornerRadius"
                                                 DataType="CornerRadius"
                                                 Value="8" />
                                <DynamicDataItem Name="MouseRolloverDisableWhenSelected"
                                                 DataType="Boolean"
                                                 Value="True" />
                            </DynamicDataSource>
                        </Setter.Value>
                    </Setter>
                </Style>
            </ControlTemplate.Resources>
            <Grid>
                <Decorator RenderTransformOrigin="0.5,0.5">
                    <local:FZMaterial x:Name="DropShadow"
                                      Style="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}"
                                      Margin="-2"
                                      RenderTransformOrigin="0.5,0.5"
                                      IsHitTestVisible="False"
                                      Visibility="{Binding IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" >
                        <FZMaterial.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform
                                    ScaleX="0"
                                    ScaleY="0"
                                    x:Name="ShadowScale" />
                            </TransformGroup>
                        </FZMaterial.RenderTransform>
                    </local:FZMaterial>
                </Decorator>
                <Decorator RenderTransformOrigin="0.0,0.5" HorizontalAlignment="Center" VerticalAlignment="Center"
                        Visibility="Visible">
                    <Grid Visibility="{Binding SelectedItem, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}, FallbackValue=Collapsed}">
                        <ContentPresenter Width="{StaticResource A_Double_OnlineAdventureSelect_Tile_Width}"
                                        Height="{StaticResource A_Double_OnlineAdventureSelect_Tile_Height}" 
                                        VerticalAlignment="Center"/>
                    </Grid>
                </Decorator>

                <Grid x:Name="ScaledContainer"
                        Width="{StaticResource A_Double_OnlineAdventureSelect_Tile_Width}"
                        Height="{StaticResource A_Double_OnlineAdventureSelect_Tile_Height}"
                        RenderTransformOrigin="0.5,0.5">
                    <StrokeHighlightControl
                        x:Name="FocusHighlight"
                        Style="{StaticResource H_Style_StrokeHighlight_Animated}"
                        Margin="0"
                        ContentRadius="8"
                        IsEnabled="{Binding (Selector.IsSelected), FallbackValue=False, RelativeSource={RelativeSource TemplatedParent}}" />
                    <Grid Width="{StaticResource A_Double_OnlineAdventureSelect_Tile_Width}">
                        <local:AudioEvent x:Name="Audio" />
                        <local:RoutedEventCommand x:Name="ClickOnMouseItem"
                                                    RoutedEvent="UIElement.MouseLeftButtonDown"/>
                        <local:FZMaterial Color="#00000000"
                                            x:Name="HitTestHelper"
                                            local:RoutedEventCommand.Action="{Binding ElementName=ClickOnMouseItem}"/>
                    </Grid>
                </Grid>

                <Control Style="{StaticResource A_Style_Control_MouseRollover_Outer_All_8px}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <DataTrigger Binding="{Binding (Selector.IsSelected), RelativeSource={RelativeSource Self}}"
                                    Value="True">
                    <Setter TargetName="ClickOnMouseItem" Property="Command" Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}"/>
                </DataTrigger>
                <Trigger Property="Selector.IsSelected" Value="True">
                    <Setter Property="local:ScreenReader.Event" Value="OnChange"/>
                    <Setter Property="local:ScreenReader.ControlType" Value="Button"/>
                    <Setter Property="local:ScreenReader.LineType" Value="SelectedItem"/>
                    <Setter Property="local:ScreenReader.SelectedNumber" Value="{Binding (VirtualizingWrapPanel.ItemIndex), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"/>
                    <Setter Property="local:ScreenReader.SelectedCount" Value="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}}"/>
                    <Setter Property="local:ScreenReader.Line" Value="{Binding Heading}"/>
                </Trigger>
                <Trigger
                    Property="Selector.IsSelected"
                    Value="True">
                    <Trigger.EnterActions>
                        <BeginStoryboard
                            x:Name="ShowSelected_BeginStoryboard2"
                            HandoffBehavior="SnapshotAndReplace"
                            Storyboard="{StaticResource H_Storyboard_Carousel_ContainerStyle_SelectItemStory}" />
                    </Trigger.EnterActions>
                    <Trigger.ExitActions>
                        <BeginStoryboard
                            x:Name="HideSelected_BeginStoryboard2"
                            HandoffBehavior="SnapshotAndReplace"
                            Storyboard="{StaticResource H_Storyboard_Carousel_ContainerStyle_DeselectItemStory}" />
                    </Trigger.ExitActions>
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="A_Style_ListBoxItem_ItemTile" TargetType="ListBoxItem">
            <Setter Property="Width" Value="{StaticResource A_Double_OnlineAdventureSelect_Tile_Width}" />
            <Setter Property="Focusable" Value="True" />
            <Setter Property="Template" Value="{StaticResource A_ControlTemplate_ContentControl_ItemTile}" />
            <Style.Triggers>
                <Trigger 
                    Property="IsKeyboardFocusWithin" 
                    Value="True">
                    <Trigger.EnterActions>
                        <RaiseRoutedEvent 
                            RoutedEvent="Selector.Selected"/>
                    </Trigger.EnterActions>
                </Trigger>
                <MultiDataTrigger>
                    <MultiDataTrigger.Conditions>
                        <Condition Binding="{Binding (Selector.IsSelected), RelativeSource={RelativeSource Self}}" 
                                   Value="True" />
                        <Condition Binding="{Binding HasPopups, RelativeSource={RelativeSource AncestorType=Page}}"
                                   Value="False" />
                    </MultiDataTrigger.Conditions>
                    <Setter 
                        Property="FocusSelf.WhenTrue" 
                        Value="True" />
                </MultiDataTrigger>
            </Style.Triggers>
        </Style>

        <!--  intentionally left without entries as there is a fallback value defined where this is used for when a tile does not have a MoreInfoCommand defined  -->
        <local:MappingConverter x:Key="A_Converter_HasMoreInfoCommand" Default="Visible">
        </local:MappingConverter>

        <Style x:Key="A_Style_ProgressBar_LevelProgress" TargetType="{x:Type ProgressBar}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ProgressBar}">
                        <Grid Height="32">
                            <FZMaterial Height="20"
                                        Color="#FF606060"
                                        Preset="{Roundtangle CornerRadius=10}"
                                        Margin="6,0"
                                        x:Name="PART_Track">
                                <FZMaterial Color="{StaticResource H_Color_Primary_White}"
                                        HorizontalAlignment="Left"
                                        x:Name="PART_Indicator"
                                        ClipToBounds="True"/>
                            </FZMaterial>
                            <!-- This border is here to make sure that the progress bar Indicator does not spill out while still being not rounded on the right -->
                            <Border Height="32"
                                    Background="#00000000"
                                    CornerRadius="13"
                                    BorderThickness="6"
                                    BorderBrush="{SolidColorBrush Color={StaticResource H_Color_Primary_Black}}"/>
                        </Grid>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

        <DataTemplate DataType="{x:Type local:HorizonOpenLevelDataItem}">
            <Grid HorizontalAlignment="Right" Width="460">
                <StackPanel VerticalAlignment="Center">
                    <FZMaterial Height="48">
                        <DockPanel>
                            <FZMaterial DockPanel.Dock="Right"
                                        Color="{StaticResource H_Color_Primary_Black}"
                                        Height="40"
                                        Preset="{Roundtangle CornerRadius={CornerRadius TopLeft=20, BottomLeft=20}}"
                                        Margin="0,0,4,0">
                                <Decorator RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}" RenderTransformOrigin="0.5,0.5">
                                    <FZTextBlock Text="{Binding XPToNextLevel, Converter={StaticResource A_NumUnitConverter_NoUnit_0dp}}" 
                                                 Visibility="{Binding IsMaxLevel, Converter={StaticResource A_Converter_BoolToVis_Inverted}}"
                                                 Color="{StaticResource H_Color_Primary_Yellow}" 
                                                 CapHeight="21"
                                                 Margin="24,0,6,0" 
                                                 VerticalAlignment="Center"/>
                                </Decorator>
                            </FZMaterial>
                            <StackPanel Orientation="Horizontal">
                                <FZTextBlock Text="{Binding IsMaxLevel, Converter={StaticResource A_MappingConverter_IsMaxHorizonOpenLevelToLevelBannerText}}" 
                                             FontFamily="Horizon_C" Color="{StaticResource H_Color_Primary_Black}" 
                                             CapHeight="21"
                                             Margin="10,0,0,0" 
                                             VerticalAlignment="Center"/>
                                <FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HorizonPlay/Play_Trophy.png" 
                                            Visibility="{Binding IsMaxLevel, Converter={StaticResource A_Converter_BoolToVis}}"
                                            GetSizeFromTexture="True" 
                                            VerticalAlignment="Center"/>
                            </StackPanel>
                        </DockPanel>
                    </FZMaterial>
                    <FrameworkElement Height="12"/>
                    <FZMaterial Color="{StaticResource H_Color_Primary_Black}"
                                Height="32"
                                Preset="{Roundtangle CornerRadius=16}">
                        <DockPanel>
                            <Decorator DockPanel.Dock="Right" RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}" RenderTransformOrigin="0.5,0.5">
                                <FZTextBlock Text="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                                             local:MultiStringFormatter.Format="{local:Loc RoadTrip.IDS_Next_Level_Format}"
                                             local:MultiStringFormatter.Param0="{Binding NextLevel}"
                                             Color="{StaticResource H_Color_Primary_White}" CapHeight="18" Margin="24,0,16,0" VerticalAlignment="Center"/>
                            </Decorator>
                            <ProgressBar Style="{StaticResource A_Style_ProgressBar_LevelProgress}"
                                         Minimum="0"
                                         Maximum="1"
                                         Value="{Binding ProgressToNextLevel}"
                                         Width="350"
                                         HorizontalAlignment="Left"/>
                        </DockPanel>
                    </FZMaterial>
                </StackPanel>
            </Grid>
        </DataTemplate>
    </Page.Resources>

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

        <ContentControl Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel"
                                        Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A"
                                            Description="{local:Loc HelpButtons.IDS_QuickPlay_Matchmake}" />
                <local:ControllerButtonControl Button="B"
                                            Description="{local:Loc HelpButtons.IDS_Back}" />
                <local:ControllerButtonControl Button="Y"
                                            Description="{local:Loc HelpButtons.IDS_QuickPlay_MoreInfo}"
                                            Visibility="{Binding SelectedItem.MoreInfoCommand, FallbackValue=Collapsed, ElementName=PART_Collection, Converter={StaticResource A_Converter_HasMoreInfoCommand}}" />
                <local:ControllerButtonControl Button="{Binding Button, ElementName=ViewMoreRewardsInputHandler}"
                                               Description="{local:Loc RoadTrip.IDS_HorizonPlay_ViewMoreRewards}" />
                <local:ControllerButtonControl Button="Back"
                                            Description="{local:Loc HelpButtons.IDS_Rivals_ViewRestrictions}"
                                            Visibility="{Binding SelectedItem.HasRestrictions, FallbackValue=Collapsed, ElementName=PART_Collection, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
            </local:ControllerButtonPanel>
        </ContentControl>
        
        <Border Style="{StaticResource A_Style_Border_ScenePadding}">
            <Grid x:Name="PART_LayoutRoot" KeyboardNavigation.DirectionalNavigation="Contained">
                <Grid Style="{StaticResource A_Style_FrameworkElement_ScreenTilt}" Margin="0,-6,0,0">
                    <StackPanel Orientation="Vertical" VerticalAlignment="Top" HorizontalAlignment="Center">
                        <Grid Margin="0,0,0,10" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" Height="156">
                            <FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/HorizonPlay/Play_Topper.png" 
                                        Width="1748"
                                        Height="188"
                                        Margin="0,-50,0,0"
                                        ScreenReader.Line="{Binding ScreenTitle}"
                                        ScreenReader.Event="OnLoad"
                                        ScreenReader.LineType="ScreenTitle"/>

                            <Grid HorizontalAlignment="Left" MinWidth="460" Height="92" Margin="66,0,0,0" DataContext="{Binding LevelData}">
                                <FZMaterial Height="32" Color="{StaticResource H_Color_Primary_Black}" VerticalAlignment="Bottom" Margin="50,0,0,0">
                                    <FZTextBlock Text="{local:Loc RoadTrip.IDS_Current_Level}" FontFamily="Horizon_A" Color="{StaticResource H_Color_Primary_White}" CapHeight="19" Margin="64,0,0,0" VerticalAlignment="Center"/>
                                </FZMaterial>
                                <FZMaterial Height="92" Width="92" Preset="{Roundtangle CornerRadius=46}" HorizontalAlignment="Left" Color="#FFB2B2B2">
                                    <FZMaterial Height="80" Width="80" Preset="{Roundtangle CornerRadius=40}">
                                        <Decorator RenderTransform="{StaticResource A_SkewTransform_HUD_Italics}" RenderTransformOrigin="0.5,0.5">
                                            <FZTextBlock Text="{Binding HorizonOpenLevel}"
                                                         FontFamily="HorizonB" 
                                                         Color="{StaticResource H_Color_Primary_Black}"
                                                         CapHeight="41"
                                                         VerticalAlignment="Center" 
                                                         HorizontalAlignment="Center"
                                                         StretchDirection="DownOnly"
                                                         Margin="6,0"/>
                                        </Decorator>
                                    </FZMaterial>
                                </FZMaterial>
                                <StackPanel Orientation="Horizontal" Margin="114,0,26,50"  VerticalAlignment="Bottom">
                                    <local:FZTextBlock Text="{Binding UserProfile.FormattedGamertag}"
                                           Color="{StaticResource H_Color_Primary_Black}"
                                           Style="{StaticResource A_Style_FZTextBlock_PlayerBarBold}"
                                           CapHeight="24"/>
                                    <local:PlayerAdornmentControl BadgeId="{Binding UserProfile.BadgeId}" Height="20" Width="24"/>
                                </StackPanel>
                            </Grid>

                            <ContentPresenter Content="{Binding LevelData}" Margin="0,0,68,0"/>
                        </Grid>
                        <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" HorizontalAlignment="Center">
                            <DockPanel>
                                <ScrollBar Style="{StaticResource A_Style_ScrollBar_Default}"
                                           Height="auto"
                                           Orientation="Vertical"
                                           Minimum="{Binding ScrollWindowMin, ElementName=PART_Collection}"
                                           Maximum="{Binding ScrollWindowMax, ElementName=PART_Collection}"
                                           Value="{Binding ScrollWindowValue, ElementName=PART_Collection, Mode=TwoWay}"
                                           ViewportSize="{Binding ScrollWindowSize, ElementName=PART_Collection}"
                                           DockPanel.Dock="Right"
                                           Margin="2,2,0,0" />
                                <Decorator Margin="-40" ClipToBounds="True">
                                    <local:WrapListBox x:Name="PART_Collection"
                                                       Style="{StaticResource A_Style_Carousel_CampaignEventFlyer}"
                                                       ItemsSource="{Binding AdventureItems}"
                                                       SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
                                                       ItemContainerStyle="{StaticResource A_Style_ListBoxItem_ItemTile}"
                                                       ItemWidth="{StaticResource A_Double_OnlineAdventureSelect_Tile_Width_withSpacing}"
                                                       ItemHeight="{StaticResource A_Double_OnlineAdventureSelect_Tile_Height_WithSpacing}"
                                                       ScrollOrientation="Vertical"
                                                       local:FocusOnPageFocusGained.SelectorSelectedItem="True"
                                                       Margin="40"
                                                       PageSize="3"
                                                       SelectionLimitTop="0"
                                                       SelectionLimitBottom="58"
                                                       Height="690"
                                                       Width="1728">
                                        <local:WrapListBox.EmptyItemStyle>
                                            <Style TargetType="Control" >
                                                <Setter Property="Focusable" Value="False"/>
                                                <Setter Property="Template">
                                                    <Setter.Value>
                                                        <ControlTemplate>
                                                            <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                                                              Preset="{StaticResource H_GlassRoundtangle_8px}"
                                                                              Margin="2" />
                                                        </ControlTemplate>
                                                    </Setter.Value>
                                                </Setter>
                                            </Style>
                                        </local:WrapListBox.EmptyItemStyle>
                                    </local:WrapListBox>
                                    <Decorator.OpacityMask>
                                        <LinearGradientBrush EndPoint="0,1">
                                            <GradientStop Color="#FFFFFFFF"
                                                          Offset="0.0" />
                                            <GradientStop Color="#FFFFFFFF"
                                                          Offset="0.86" 
                                                          x:Name="MiddleFadeStart" />
                                            <GradientStop Color="#00FFFFFF"
                                                          Offset="0.95"
                                                          x:Name="MiddleFadeEnd" />
                                        </LinearGradientBrush>
                                    </Decorator.OpacityMask>
                                </Decorator>
                                
                            </DockPanel>
                        </Grid>

                    </StackPanel>
                </Grid>
            </Grid>
        </Border>

        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.Back}"
                                Command="{Binding SelectedItem.ShowRestrictions, ElementName=PART_Collection}" />

        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.Y}"
                                Command="{Binding SelectedItem.MoreInfoCommand, ElementName=PART_Collection}" />
        <local:PageInputHandler Button="{x:Static local:ControllerButtonType.X}"
                                Command="{Binding ViewMoreRewardsCommand}" 
                                x:Name="ViewMoreRewardsInputHandler"/>
    </Grid>
</Page>
