<Page x:Class="ForzaUI.Scenes.Anthem.A_PopupOnlineAdventureSelect"
      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_Size_AdventureTileUnitSize">425</System:Double>
        <System:Double x:Key="A_Double_Size_AdventureTileUnitSizeWithGap">431</System:Double>

        <local:LinearTransformConverter x:Key="A_LinearTransformConverter_AdventureTilePositionTransform" 
                                        Scale="{StaticResource A_Double_Size_AdventureTileUnitSize}"/>

        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToTitleIcon">
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.RankedAdventure}" Value="/ForzaUI;component/Textures/Anthem/Icons/Ranked_Adventure_Icon.png" />
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.UnrankedAdventure}" Value="/ForzaUI;component/Textures/Anthem/Icons/Quickplay_Adventure_Icon.png" />
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.DriftRunAdventure}" Value="/ForzaUI;component/Textures/Data_Bound/Series8/Drift_Run/Pause_Menu/Titles/Drift_Run.png" />
        </local:MappingConverter >
        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToTitle">
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.RankedAdventure}" Value="{local:Loc ScreenTitles.IDS_OnlineAdventure_Ranked_Title}" />
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.UnrankedAdventure}" Value="{local:Loc ScreenTitles.IDS_OnlineAdventure_Unranked_Title}" />
            <local:MappingConverterEntry Key="{x:Static local:AdventureSelectionType.DriftRunAdventure}" Value="{local:Loc ScreenTitles.IDS_OnlineAdventure_DriftRun_Title}" />
        </local:MappingConverter >

        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToRaceEventImage">
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedPlaygroundGamesOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Games.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedPlaygroundGamesOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Games.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedAnythingGoes}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Anything_Goes.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedAnythingGoes}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/Anything_Goes.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedSoloRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/SoloRacing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedSoloRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/SoloRacing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedDriftRun}" Value="/ForzaUI;component/Textures/Data_Bound/Series8/Drift_Run/Pause_Menu/Image_Tiles/Ranked_Drift.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedDriftRun}" Value="/ForzaUI;component/Textures/Data_Bound/Series8/Drift_Run/Pause_Menu/Image_Tiles/Quickplay_Drift.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.SoloCustom}" Value="/ForzaUI;component/Textures/Data_Bound/Series9/Custom_Adventure.png"/>
        </local:MappingConverter>
        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToHeading">
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedRacingOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Ranked_Racing_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedRacingOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Racing_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedPlaygroundGamesOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Ranked_Games_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedPlaygroundGamesOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Games_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedAnythingGoes}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Ranked_AnythingGoes_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedAnythingGoes}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_AnythingGoes_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedSoloRacingOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Ranked_SoloRacing_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedSoloRacingOnly}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_SoloRacing_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedDriftRun}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Ranked_DriftRun_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedDriftRun}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_DriftRun_Title}"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.SoloCustom}" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_SoloCustom_Title}"/>
        </local:MappingConverter>
        <local:MappingConverter x:Key="A_MappingConverter_AdventureTypeToFloatingIcon">
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedRacingOnly}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedRacingOnly}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Racing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedPlaygroundGamesOnly}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Games.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedPlaygroundGamesOnly}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Games.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedAnythingGoes}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Anything_Goes.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedAnythingGoes}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Adventure_Anything_Goes.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedSoloRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/FloatingIcon_SoloRacing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedSoloRacingOnly}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/FloatingIcon_SoloRacing.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.RankedDriftRun}" Value="/ForzaUI;component/Textures/Data_Bound/Series8/Drift_Run/Pause_Menu/Floating_Icons/Drift_Run.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.UnrankedDriftRun}" Value="/ForzaUI;component/Textures/Data_Bound/Series8/Drift_Run/Pause_Menu/Floating_Icons/Drift_Run.png"/>
            <local:MappingConverterEntry Key="{x:Static local:AdventureSession.SoloCustom}" Value="/ForzaUI;component/Textures/Data_Bound/OnlineAdventurePreview/FloatingIcon_SoloRacing.png"/>
        </local:MappingConverter>

        <!--control template with overriding triggers -->
        <Style x:Key="A_Style_ContentControl_FloatingIcon_Adventure_Tile" TargetType="{x:Type ContentControl}" 
               BasedOn="{StaticResource A_Style_ContentControl_FloatingIcon_Tile}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate>
                        <Grid>
                            <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Icon_Shadow.png" Width="108" Height="108" Margin="-18,0,0,45" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FloatingIconShadow}">
                                <local:FZMaterial x:Name="FloatingIconBackground" Style="{StaticResource A_Style_FZMaterial_FloatingIcon}">
                                    <local:FZMaterial x:Name="FloatingIconContent"
                                    ImageSource="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"/>
                                </local:FZMaterial>
                            </local:FZMaterial>
                        </Grid>
                        <ControlTemplate.Triggers>
                            <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetroundtangle_FlatPanel_FloatingIcon}" TargetName="FloatingIconBackground" />
                                <Setter Property="Color"  Value="{StaticResource A_Color_Tile_FloatingIcon_Background_Locked}" TargetName="FloatingIconBackground" />
                                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Locked.png" TargetName="FloatingIconContent" />
                            </DataTrigger>
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
        
        <!--todo Add style to green qualify text -->
        <Style x:Key="A_Style_FZRun_HIGHLIGHT" TargetType="local:FZRun">
            <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text_Alternate}" />
        </Style>

        <Style x:Key="A_Style_FZTextblock_YourRank" TargetType="local:FZTextBlock">
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
            <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding RatingText}"/>
            <Setter Property="CapHeight" Value="24"/>
            <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
        </Style>
        <Style x:Key="A_Style_FZTextblock_AdventureTile_Description" TargetType="local:FZTextBlock"
               BasedOn="{StaticResource A_Style_FZTextBlock_TileText_Base}">
            <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_"/>
        </Style>
        <local:UIStoryboard x:Key="A_Storyboard_Selection_Changed_Audio">
            <local:UIStoryboard.TriggerAnimation>
                <local:StartAudioTrigger local:TriggerAnimation.KeyTime="0:0:0.0" EventName="/Master/UI/PauseMenu/HZ2_SFX_UI_PauseMenu_Move_01"/>
            </local:UIStoryboard.TriggerAnimation>
        </local:UIStoryboard>

        <Style x:Key="A_Style_FrameworkElement_NewTagContainer"
               TargetType="{x:Type FrameworkElement}">
            <Setter Property="Margin" Value="-0.5,0" />
            <Setter Property="Visibility" Value="Collapsed" />
            <Style.Triggers>
                <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ContentControl}, FallbackValue=False}"
                             Value="True">
                    <Setter Property="Margin" Value="1,0" />
                </DataTrigger>
                <!-- ADD Trigger Here for which tile should have new on it-->
            </Style.Triggers>
        </Style>

        <ControlTemplate x:Key="A_ControlTemplate_AdventureTile" TargetType="{x:Type local:FZButton}">
            <Grid Focusable="False" Margin="0,0,6,0">
                <Grid>
                    <local:FZMaterial x:Name="DropShadow" Style="{StaticResource A_Style_FZMaterial_TileDropShadow}" Margin="-36"/>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoAlternate}"
                                      Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
                                      Visibility="{Binding UseAlternateColors, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                        <Grid>
                            <local:FZMaterial x:Name="TileImage" Style="{StaticResource A_Style_FZMaterial_TileBackground}"
                                      ImageSource="{Binding AdventureSession, Converter={StaticResource A_MappingConverter_AdventureTypeToRaceEventImage}}"
                                      VerticalAlignment="Top" Margin="3"
                                      Height="620" Width="Auto">

                                <Grid x:Name="RankInfo" VerticalAlignment="Bottom" 
                                      Visibility="{Binding IsRanked, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" >
                                    <local:FZMaterial Color="{StaticResource A_Color_Tile_TintedPanel}" Height="104" VerticalAlignment="Bottom" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterBottomOnly}">
                                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextblock_YourRank}" VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="0,0,0,30" />
                                    </local:FZMaterial>

                                    <Control Style="{StaticResource A_Style_Control_LeagueEmblem_Big}" DataContext="{Binding RankData}" 
                                             HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,0,0,45"/>
                                </Grid>
                            </local:FZMaterial>

                            <Grid VerticalAlignment="Bottom" Height="{StaticResource A_Double_Size_Tile_TitlePanel}">
                                <StackPanel Margin="20" VerticalAlignment="Center" HorizontalAlignment="Center">
                                    <local:FZTextBlock x:Name="TileTitle" Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Top"
                                                           Text="{Binding AdventureSession, Converter={StaticResource A_MappingConverter_AdventureTypeToHeading}}"/>
                                    <Decorator Height="10"/>
                                    <local:FZTextBlock x:Name="TileDescription" Style="{StaticResource A_Style_FZTextblock_AdventureTile_Description}"
                                                           HorizontalAlignment="Center"
                                                           VerticalAlignment="Bottom"
                                                           local:TextBlockInlineMarkup.Markup="{Binding Description}"/>
                                </StackPanel>
                            </Grid>
                        </Grid>
                    </local:FZMaterial>
                    <ContentControl x:Name="FloatingIcon" Content="{Binding AdventureSession, Converter={StaticResource A_MappingConverter_AdventureTypeToFloatingIcon}}"
                                Style="{StaticResource A_Style_ContentControl_FloatingIcon_Adventure_Tile}" Margin="10,0,0,0"/>
                    <ContentControl Focusable="False" Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" />
                </Grid>
                <Grid x:Name="NewTag"
                      ClipToBounds="True"
                      Style="{StaticResource A_Style_FrameworkElement_NewTagContainer}">
                    <local:FZMaterial Height="54"
                                      Width="220"
                                      Color="#FF00B592"
                                      HorizontalAlignment="Right"
                                      VerticalAlignment="Top"
                                      Margin="0,20,-60,0"
                                      RenderTransformOrigin="0.5,0.5">
                        <local:FZMaterial.RenderTransform>
                            <RotateTransform Angle="45" />
                        </local:FZMaterial.RenderTransform>
                        <local:FZTextBlock Text="{local:Loc InGame.IDS_New}"
                                           CapHeight="24"
                                           MaxWidth="115"
                                           Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                           Color="{StaticResource A_Color_Tile_Title_Alternate}"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center" />
                    </local:FZMaterial>
                </Grid>
            </Grid>
            <ControlTemplate.Triggers>
                <DataTrigger Binding="{Binding LockState}" Value="{x:Static local:LockState.Locked}">
                    <Setter Property="Preset" TargetName="TileImage" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAllDesaturated}"/>
                    <Setter Property="Content" TargetName="FloatingIcon" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Locked.png"/>
                    <Setter Property="Color" TargetName="TileTitle" Value="{StaticResource A_Color_Tile_Text_Locked}"/>
                    <Setter Property="Text" TargetName="TileDescription" Value="{local:Loc RoadTrip.IDS_OnlineAdventure_Not_Available_Description}"/>
                    <Setter Property="Visibility" TargetName="RankInfo" Value="Hidden"/>
                </DataTrigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="FocusManager.FocusedElement" Value="{Binding RelativeSource={RelativeSource Self}}" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="A_Style_Button_Tile_OnlineAdventure"
               TargetType="{x:Type local:FZButton}"
               BasedOn="{StaticResource A_Style_Button_RootTile}">
            <Setter Property="Width" Value="{StaticResource A_Double_Size_AdventureTileUnitSize}"/>
            <Setter Property="Command" Value="{Binding OnSelectCommand}"/>
            <Setter Property="local:ZPanel.ZIndex" Value="0"/>
            <Setter Property="local:ZPanel.ZOffset" Value="0"/>
            <Setter Property="Height" Value="720"/>
        </Style>

        <Style x:Key="A_Style_Button_Container_Style" TargetType="{x:Type ListBoxItem}">
            <Setter Property="Panel.ZIndex" Value="0"/>
            <Setter Property="Focusable" Value="False"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type ListBoxItem}">
                            <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsKeyboardFocusWithin" Value="True">
                    <Setter Property="Panel.ZIndex" Value="5"/>
                    <Setter Property="Selector.IsSelected" Value="True"/>
                </Trigger>
            </Style.Triggers>
        </Style>
    </Page.Resources>

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

        <local:PlayerBarControl x:Name="TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="HelpPanel"
                                        Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A"
                                            Description="{local:Loc HelpButtons.IDS_Select}" />
                <local:ControllerButtonControl Button="B"
                                            Description="{local:Loc HelpButtons.IDS_Back}" />
                <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="LayoutRoot">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                    <StackPanel Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
                        <StackPanel Orientation="Horizontal" Margin="0,0" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                            <ContentControl Content="{Binding AdventureSelectionType, Converter={StaticResource A_MappingConverter_AdventureTypeToTitle}}" Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"
                                            local:BindingProxy.A="{Binding AdventureSelectionType, Converter={StaticResource A_MappingConverter_AdventureTypeToTitleIcon}}"/>
                        </StackPanel>

                        <local:CommonListBox ItemsSource="{Binding AdventureItems}" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0" 
                                    ItemContainerStyle="{StaticResource A_Style_Button_Container_Style}" ScrollViewer.CanContentScroll="False" 
                                    local:FocusOnPageFocusGained.SelectorSelectedItem="True" x:Name="PART_Collection" AlternationCount="10">
                            <local:CommonListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel KeyboardNavigation.DirectionalNavigation="Contained" Orientation="Horizontal" IsItemsHost="True">
                                        <StackPanel.Style>
                                            <Style TargetType="StackPanel">
                                                <Style.Triggers>
                                                    <EventTrigger RoutedEvent="LostKeyboardFocus">
                                                        <local:BeginUIStoryboard Storyboard="{StaticResource A_Storyboard_Selection_Changed_Audio}"/>
                                                    </EventTrigger>
                                                </Style.Triggers>
                                            </Style>
                                        </StackPanel.Style>
                                    </StackPanel>
                                </ItemsPanelTemplate>
                            </local:CommonListBox.ItemsPanel>
                            <local:CommonListBox.ItemTemplate>
                                <DataTemplate >
                                    <local:FZButton Style="{StaticResource A_Style_Button_Tile_OnlineAdventure}" 
                                                    Template="{StaticResource A_ControlTemplate_AdventureTile}" 
                                                    local:ScreenReader.Line="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}}"
                                                    local:ScreenReader.LineType="SelectedItem"
                                                    local:ScreenReader.Event="OnFocus"
                                                    local:ScreenReader.ControlType="Button"
                                                    local:ScreenReader.SelectedNumber="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"
                                                    local:ScreenReader.SelectedCount="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type ListBox}}, FallbackValue=0}"
                                                    local:MultiStringFormatter.Format="{StaticResource A_String_012FormatString}"
                                                    local:MultiStringFormatter.Param0="{Binding AdventureSession, Converter={StaticResource A_MappingConverter_AdventureTypeToHeading}}"
                                                    local:MultiStringFormatter.Param1=" "
                                                    local:MultiStringFormatter.Param2="{Binding Description}"/>
                                </DataTemplate>
                            </local:CommonListBox.ItemTemplate>
                        </local:CommonListBox>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>

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

    </Grid>
</Page>
