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

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

    <Page.Resources>
        <ResourceDictionary>

            <System:Double x:Key="A_Double_ChapterItemHeight">54</System:Double>
            <System:Double x:Key="A_Double_ChapterSelectionWidth">788</System:Double>
            <System:Double x:Key="A_Double_ChapterSelectionGoalTileWidth">260</System:Double>

            <Style x:Key="A_Style_FZRun_NUM" TargetType="{x:Type local:FZRun}">
                <Setter Property="FontFamily" Value="Horizon_A" />
             </Style>

            <Style x:Key="A_Style_FZRun_BOLD" TargetType="{x:Type local:FZRun}">
                <Setter Property="FontFamily" Value="Horizon_C" />
                <Setter Property="Color"  Value="{StaticResource H_Color_Primary_Yellow}" />
            </Style>

            <MappingConverter x:Key="A_MappingConverter_Text">
                <MappingConverterEntry Key="{NoCase NUM}" Value="{StaticResource A_Style_FZRun_NUM}" />
                <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_FZRun_BOLD}" />
            </MappingConverter>

            <Style x:Key="A_Style_FZMaterial_StarIcon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="28"/>
                <Setter Property="Height" Value="28"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_HeaderStarIcon" TargetType="local:FZMaterial">
                <Setter Property="Width" Value="44"/>
                <Setter Property="Height" Value="44"/>
            </Style>
                
            <Style x:Key="A_Style_FZMaterial_InactiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_StarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon_White.png"/>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Grey_70pc}"/>
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_ActiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_StarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon.png"/>
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_HeaderInactiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_HeaderStarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon_White.png"/>
                <Setter Property="Margin" Value="6,0,7,0"/> 
            </Style>
            
            <Style x:Key="A_Style_FZMaterial_HeaderActiveStar" TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_HeaderStarIcon}">
                <Setter Property="ImageSource" Value="/ForzaUI;component/Textures/Anthem/Icons/Star_Icon.png"/>
                <Setter Property="Margin" Value="5,0,5,0"/>
            </Style>
                        
            <!-- ControlTemplate for the star counter used in list-->
            <ControlTemplate x:Key="A_ControlTemplate_StarDisplay" >
                <Grid HorizontalAlignment="Right" >
                    <Decorator DockPanel.Dock="Left" HorizontalAlignment="Left" Margin="0,0,-10,0" Height="50">
                        <StackPanel x:Name="StarContainer" Orientation="Horizontal" Margin="0,0,10,0">
                            <local:FZMaterial x:Name="Star1" Style="{StaticResource A_Style_FZMaterial_ActiveStar}" Visibility="Visible" Margin="2,0,2,0"/>
                            <local:FZMaterial x:Name="Star2" Style="{StaticResource A_Style_FZMaterial_ActiveStar}" Visibility="Visible" Margin="2,0,2,0"/>
                            <local:FZMaterial x:Name="Star3" Style="{StaticResource A_Style_FZMaterial_ActiveStar}" Visibility="Visible" Margin="2,0,2,0"/>
                        </StackPanel>    
                     </Decorator>
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                     <local:FZMaterial x:Name="Star1Off" Style="{StaticResource A_Style_FZMaterial_InactiveStar}" Visibility="Collapsed" Margin="2,0,2,0"/>
                     <local:FZMaterial x:Name="Star2Off" Style="{StaticResource A_Style_FZMaterial_InactiveStar}" Visibility="Collapsed" Margin="2,0,2,0"/>
                     <local:FZMaterial x:Name="Star3Off" Style="{StaticResource A_Style_FZMaterial_InactiveStar}" Visibility="Collapsed" Margin="2,0,2,0"/>
                        </StackPanel>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding StarCount}" Value="0">
                        <Setter TargetName="Star1" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star1Off" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2Off" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3Off" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding StarCount}" Value="1">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star1Off" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2Off" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3Off" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding StarCount}" Value="2">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="Star1Off" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="Star2Off" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="Star3Off" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            
        </ControlTemplate>
            <Style x:Key="A_Style_ControlTemplate_StarDisplay" TargetType="{x:Type Control}">
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarDisplay}"/>
            </Style>

            <!--Control for a star used in the header-->
            <ControlTemplate x:Key="A_ControlTemplate_StarHeader">
                <Grid>
                    <local:FZMaterial x:Name="StarImageOff" Style="{StaticResource A_Style_FZMaterial_HeaderInactiveStar}"/>
                    <local:FZMaterial x:Name="StarImageOn" Visibility="Collapsed"
                                      Style="{StaticResource A_Style_FZMaterial_HeaderActiveStar}"/>
                </Grid>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter TargetName="StarImageOn" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="StarImageOff" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="A_Style_StarHeader" TargetType="{x:Type Control}" >
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarHeader}"/>
                <Setter Property="Tag" Value="0"/>
            </Style>

            <!--Slightly Different Control for the star bar used in the header-->
            <ControlTemplate x:Key="A_ControlTemplate_StarDisplay_Header" >
                <StackPanel x:Name="StarContainerHeader" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Control x:Name="Star1" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                    <Control x:Name="Star2" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                    <Control x:Name="Star3" Style="{StaticResource A_Style_StarHeader}" Visibility="Collapsed" Tag="False"/>
                </StackPanel>
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="1">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="2">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Collapsed"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}" Value="3">
                        <Setter TargetName="Star1" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star2" Property="Visibility" Value="Visible"/>
                        <Setter TargetName="Star3" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                    <DataTrigger Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="True">
                        <Setter TargetName="Star1" Property="Tag" Value="True"/>
                        <Setter TargetName="Star2" Property="Tag" Value="True"/>
                        <Setter TargetName="Star3" Property="Tag" Value="True"/>
                    </DataTrigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
            <Style x:Key="A_Style_ControlTemplate_StarDisplay_Header" TargetType="{x:Type Control}">
                <Setter Property="Template" Value="{StaticResource A_ControlTemplate_StarDisplay_Header}"/>
            </Style>

            <Style x:Key="A_Style_Control_EmptyItemStyle_Story"
                   TargetType="Control">
                <Setter Property="Focusable"
                        Value="False"/>
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="Control">
                            <DockPanel VerticalAlignment="Stretch" Margin="0,2,0,2">
                                <FZMaterial Preset="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}"
                                            Color="{StaticResource A_Color_GlassPanel_NonInteractive}"/>
                            </DockPanel>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <DataTemplate x:Key="A_DataTemplate_ListBoxItem_ChapterList">
                <DockPanel VerticalAlignment="Center" HorizontalAlignment="Left" Height="50" Width="{StaticResource A_Double_ChapterSelectionWidth}">
                    <Grid DockPanel.Dock="Right" Width="135" HorizontalAlignment="Right">
                        <Control VerticalAlignment="Center" HorizontalAlignment="Center"
                            x:Name="stars"
                            Style="{StaticResource A_Style_ControlTemplate_StarDisplay}" />
                        <FZMaterial Margin="8" x:Name="padlock" Visibility="Hidden" ImageSource="game:\Media\UI\Textures\Anthem\Icons\TiledMenus\SlotMenu\Locked.png" Stretch="Uniform" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
                    </Grid>
                    <local:FZMaterial DockPanel.Dock="Right" Color="{StaticResource H_Color_Primary_Grey_80pc}" Width="2" Margin="0,10,0,10" Opacity="0.8"/>

                    <local:FZTextBlock HorizontalAlignment="Left"
                                       Margin="18,0"
                                       FontFamily="Horizon_B"
                                       CapHeight="18"
                                       Style="{StaticResource A_Style_FZTextBlock_OptionText}">
                        <FZRun FontFamily="Horizon_A">
                            <FZRun.Text>
                                <Binding Path="(VirtualizingWrapPanel.ItemIndex)" RelativeSource="{RelativeSource AncestorType=ListBoxItem}">
                                    <Binding.Converter>
                                        <MultiConverter>
                                            <MultiConverterEntry TargetType="Int32" Converter="{LinearTransformConverter Add=1}"/>
                                        </MultiConverter>
                                    </Binding.Converter>
                                </Binding>
                            </FZRun.Text>
                        </FZRun>
                        <FZRun FontFamily="Horizon_A" Text=" - "/>
                        <FZRun x:Name="item_name" Text="{Binding ChapterName}"/>
                    </local:FZTextBlock>
                </DockPanel>
                <DataTemplate.Triggers>
                    <DataTrigger Binding="{Binding Locked}" Value="True">
                        <Setter TargetName="item_name" Property="Text" Value="{Loc Campaign.IDS_Stories_Locked}"/>
                        <Setter TargetName="stars" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="padlock" Property="Visibility" Value="Visible"/>
                    </DataTrigger>
                </DataTemplate.Triggers>
            </DataTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_StarConditions">
                <local:FZMaterial Height="128"
                                  Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                  Margin="0">
                    <StackPanel Orientation="Vertical"
                                Width="auto">
                        <Decorator Height="80">
                            <Control VerticalAlignment="Center" HorizontalAlignment="Center"
                                     x:Name="StarHeaderDisplay"
                                     Style="{StaticResource A_Style_ControlTemplate_StarDisplay_Header}"
                                     Tag="{Binding Tag}"
                                     local:BindingProxy.A="False"/>
                        </Decorator>
                        <Grid Height="48">
                            <Grid x:Name="MedalPanelIncomplete">
                                <local:FZMaterial Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"/>
                                <local:FZTextBlock x:Name="IncompleteTextName"
                                                   Style="{StaticResource A_Style_FZTextBlock_HorizonF}"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="12" CapHeight="18"
                                                   Color="{StaticResource H_Color_Primary_Grey_70pc}"
                                                   Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                                   MarkupConverter="{StaticResource A_MappingConverter_Text}"/>
                            </Grid>
                            <Grid x:Name="MedalPanelAchieved" Visibility="Collapsed">
                                <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Data_Bound/Anthem/HorizonStories/GoldPanel.png"
                                                  Width="auto" Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll1px}"/>
                                <local:FZTextBlock x:Name="HighlightedTextName"
                                                   Style="{StaticResource A_Style_FZTextBlock_HorizonF}"
                                                   HorizontalAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   Margin="12" CapHeight="18"
                                                   Color="{StaticResource H_Color_Primary_Black}"
                                                   Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                                   MarkupConverter="{StaticResource A_MappingConverter_Text}"/>
                            </Grid>
                            <FZMaterial Height="36" x:Name="padlock" Visibility="Hidden" ImageSource="game:\Media\UI\Textures\Anthem\Icons\TiledMenus\SlotMenu\Locked.png" Stretch="Uniform" Color="{StaticResource H_Color_Primary_Grey_70pc}"/>
                        </Grid>
                    </StackPanel>
                </local:FZMaterial>
                <!--Triggers use a compare converter to evaluate if the achieved stars are greater than or equal to requirement to activate the medal panel-->
                <ControlTemplate.Triggers>
                    <DataTrigger Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="1">
                        <Setter TargetName="StarHeaderDisplay" Property="local:BindingProxy.A" Value="True"/>
                        <Setter TargetName="MedalPanelIncomplete" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="MedalPanelAchieved" Property="Visibility" Value="Visible"/>
                    </DataTrigger>

                    <DataTrigger Binding="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource Self}}" Value="0">
                        <Setter TargetName="StarHeaderDisplay" Property="local:BindingProxy.A" Value="True"/>
                        <Setter TargetName="MedalPanelIncomplete" Property="Visibility" Value="Collapsed"/>
                        <Setter TargetName="MedalPanelAchieved" Property="Visibility" Value="Visible"/>
                    </DataTrigger>

                    <DataTrigger Binding="{Binding Locked}" Value="True">
                        <Setter TargetName="IncompleteTextName" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="HighlightedTextName" Property="Visibility" Value="Hidden"/>
                        <Setter TargetName="padlock" Property="Visibility" Value="Visible"/>
                    </DataTrigger>

                </ControlTemplate.Triggers>
            </ControlTemplate>

            <Style x:Key="H_Style_NoEmptyItem"
                TargetType="ListBoxItem">
                <Setter Property="Focusable" Value="False"/>
                <Setter Property="Visibility" Value="Collapsed"/>
            </Style>

            <Style x:Key="H_ContainerStyle_StoryChapter" TargetType="ListBoxItem" BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Gaps}">
                <Setter Property="local:ScreenReader.Event" Value="OnChange"/>
                <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}}}"/>
                <Style.Triggers>
                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}"  Value="True" />
                            <Condition Binding="{Binding Locked}" Value="False" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="local:ScreenReader.Line" Value="{Binding ChapterName}"/>
                    </MultiDataTrigger>

                    <MultiDataTrigger>
                        <MultiDataTrigger.Conditions>
                            <Condition Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}"  Value="True" />
                            <Condition Binding="{Binding Locked}" Value="True" />
                        </MultiDataTrigger.Conditions>
                        <Setter Property="local:ScreenReader.Line" Value="{Loc Campaign.IDS_Stories_Locked}"/>
                    </MultiDataTrigger>
                </Style.Triggers>
            </Style>

            <Style x:Key="H_Style_ChapterDesc" TargetType="FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}">
                <Setter Property="HorizontalAlignment" Value="Left"/>
                <Setter Property="VerticalAlignment" Value="Top"/>
                <Setter Property="Margin" Value="18"/>
                <Setter Property="CapHeight" Value="18"/>
                <Setter Property="TextWrapping" Value="Wrap"/>
                <Setter Property="FontFamily" Value="Horizon_D"/>
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
                <Setter Property="Text" Value="{Binding ChapterDescription}"/>
                <Setter Property="MarkupConverter" Value="{StaticResource A_MappingConverter_Text}"/>
                <Setter Property="LineAdjust" Value="-0.5"/>
                <Setter Property="local:ScreenReader.Event" Value="OnChange"/>
                <Setter Property="local:ScreenReader.LineType" Value="ItemDescription"/>
                <Setter Property="local:ScreenReader.Line" Value="{Binding ChapterDescription}"/>
            </Style>
        </ResourceDictionary>
        <Style x:Key="A_Style_ContentControl_ChapterButtonBar" TargetType="ContentControl" BasedOn="{StaticResource A_Style_ContentControl_DefaultButtonBar}">
            <Style.Triggers>
                <DataTrigger Binding="{Binding SkipToLastChallenge}" Value="True">
                    <Setter Property="local:ControllerButtonPanel.YDescription" Value="{Loc BucketList.IDS_ChapterSelect_SkipToLastChallenge}"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>
    </Page.Resources>

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

        <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}"
                            local:ControllerButtonPanel.XDescription="{local:Loc HelpButtons.IDS_ViewLeaderboard}"
                            Style="{StaticResource A_Style_ContentControl_ChapterButtonBar}" />
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding}">
            <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" 
                  Height="Auto" Margin="-5,87,0,0"
                  VerticalAlignment="Top"
                  Width="{StaticResource A_Double_ChapterSelectionWidth}" 
                  HorizontalAlignment="Left">
                <StackPanel VerticalAlignment="Bottom" HorizontalAlignment="Left" ClipToBounds="false">
                    <StackPanel Width="{StaticResource A_Double_ChapterSelectionWidth}" VerticalAlignment="Top"
                                Margin="0,0,0,4">
                        <!--Header-->
                        <ContentControl Content="{Loc BucketList.IDS_Stories}"
                                        HorizontalAlignment="Left"
                                        Width="{StaticResource A_Double_ChapterSelectionWidth}"
                                        local:BindingProxy.A="{Binding StoryIcon}"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}"/>

                        <!--Subtitle-->
                        <ContentControl Style="{StaticResource A_Style_ContentControl_Header}"
                                        Content="{Binding StoryName}"
                                        Margin="0,0,0,-2"
                                        HorizontalContentAlignment="Left"/>

                        <!--List Content-->
                        <Grid Height="374">
                            <ScrollBar Style="{StaticResource A_Style_ScrollBar_Default}"
                                       HorizontalAlignment="Right"
                                       Margin="0,0,-16,0"
                                       Minimum="{Binding ScrollWindowMin, ElementName=ChapterList}"
                                       Maximum="{Binding ScrollWindowMax, ElementName=ChapterList}"
                                       Value="{Binding ScrollWindowValue, ElementName=ChapterList, Mode=TwoWay}"
                                       ViewportSize="{Binding ScrollWindowSize, ElementName=ChapterList}" />

                            <Grid VerticalAlignment="Top">
                                <WrapListBox x:Name="ChapterList"
                                             Width="{StaticResource A_Double_ChapterSelectionWidth}"
                                             Template="{StaticResource H_ControlTemplate_TextMenu_Default}"
                                             ScrollOrientation="Vertical"
                                             Margin="0"
                                             MaxHeight="374"
                                             ItemHeight="{StaticResource A_Double_ChapterItemHeight}"
                                             ItemWidth="{StaticResource A_Double_ChapterSelectionWidth}"
                                             WrapSelection="True"
                                             AlternationCount="10000"
                                             ItemsSource="{Binding Chapters}"
                                             SelectedItem="{Binding SelectedItem}"
                                             ItemTemplate="{StaticResource A_DataTemplate_ListBoxItem_ChapterList}"
                                             ItemContainerStyle="{StaticResource H_ContainerStyle_StoryChapter}"
                                             EmptyItemStyle="{StaticResource A_Style_Control_EmptyItemStyle_Story}"
                                             local:FocusOnPageFocusGained.SelectorSelectedItem="True" >
                                    <WrapListBox.Resources>
                                        <Thickness x:Key="A_Margin_VirtualizingWrapPanel">0</Thickness>
                                    </WrapListBox.Resources>
                                </WrapListBox>
                            </Grid>
                        </Grid>
                    </StackPanel>
                    <!--Description Panels-->
                    <DockPanel x:Name="DescriptionAndStarBoxesRoot"
                               LastChildFill="True"
                               MaxWidth="{StaticResource A_Double_ChapterSelectionWidth}"
                               VerticalAlignment="Bottom"
                               Panel.ZIndex="-1">
                        <local:FZMaterial DockPanel.Dock="Top"
                                          Height="128"
                                          Width="auto"
                                          Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                          Margin="0,0,0,4">
                            <local:FZTextBlock Style="{StaticResource H_Style_ChapterDesc}"
                                               DataContext="{Binding SelectedItem, ElementName=ChapterList}"/>
                        </local:FZMaterial>
                        <ContentControl DockPanel.Dock="Left"
                                        Margin="0,0,0,4"
                                        Width="{StaticResource A_Double_ChapterSelectionGoalTileWidth}"
                                        Tag="1"
                                        Template="{StaticResource A_ControlTemplate_StarConditions}"
                                        DataContext="{Binding SelectedItem, ElementName=ChapterList}"
                                        Content="{Binding AchievementTarget1}"
                                        local:BindingProxy.A="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=1}" />
                        <ContentControl Margin="4,0,4,4"
                                        Width="{StaticResource A_Double_ChapterSelectionGoalTileWidth}"
                                        Tag="2"
                                        Template="{StaticResource A_ControlTemplate_StarConditions}"
                                        DataContext="{Binding SelectedItem, ElementName=ChapterList}"
                                        Content="{Binding AchievementTarget2}"
                                        local:BindingProxy.A="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=2}"/>
                        <ContentControl DockPanel.Dock="Right"
                                        Margin="0,0,0,4"
                                        Width="{StaticResource A_Double_ChapterSelectionGoalTileWidth}"
                                        Tag="3"
                                        Template="{StaticResource A_ControlTemplate_StarConditions}"
                                        DataContext="{Binding SelectedItem, ElementName=ChapterList}"
                                        Content="{Binding AchievementTarget3}"
                                        local:BindingProxy.A="{Binding StarCount, Converter={StaticResource A_CompareConverter}, ConverterParameter=3}" />
                    </DockPanel>
                </StackPanel>
            </Grid>
        </Border>
    </Grid>
</HorizonStoriesChapterSelect>