<Page x:Class="ForzaUI.Scenes.Anthem.A_PopupJumpToGroup"
      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"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}">

    <local:UIPageTransitionManager.TransitionManager>
        <local:UIPageTransitionManager Preset="{StaticResource A_UIPageTransitionManagerPreset_Popup}" />
    </local:UIPageTransitionManager.TransitionManager>
    <Grid>
        <local:FZMaterialGlassCapture />
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Popup_Background}"/>

        <!-- Bars -->
        <ContentControl x:Name="BottomBar"
                        Style="{StaticResource A_Style_ButtonBar}">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel"
                                         Layout="RightToLeft"
                                         HorizontalAlignment="Left"
                                         VerticalAlignment="Bottom"
                                         Background="{x:Null}">
            </local:ControllerButtonPanel>
        </ContentControl>

        <Grid Style="{StaticResource A_Style_FrameworkElement_LayoutRoot}">
            <StackPanel x:Name="MainContent"
                        Orientation="Horizontal"
                        HorizontalAlignment="Center"
                        VerticalAlignment="Center"
                        Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                <StackPanel Orientation="Vertical"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center">
                    <ContentControl Style="{StaticResource A_Style_ContentControl_PopupTitleBlock}"
                                    Content="{Binding Title}"
                                    Width="auto"
                                    Margin="2,0"/>
                    <WrapListBox Template="{StaticResource H_ControlTemplate_Carousel_Default}"
                                 x:Name="PART_Menu"
                                 Height="648" 
                                 Width="1408"
                                 ItemWidth="{StaticResource A_Double_GridMenuItem_WidthWithMargin}"
                                 ItemHeight="{StaticResource A_Double_GridMenuItem_HeightWithMargin}"
                                 WrapSelection="True"
                                 HorizontalAlignment="Left"
                                 OverrideAcrossNavigation="True"
                                 ScrollOrientation="Vertical"
                                 ItemContainerStyle= "{StaticResource A_Style_ListBoxItem_GridMenu_Default}"
                                 ItemTemplate= "{StaticResource A_DataTemplate_ListBoxItem_GridMenuItem}"
                                 EmptyItemStyle="{StaticResource A_Style_ListBoxItem_EmptyItemStyle_GridMenu}"
                                 ItemsSource="{Binding Options}"
                                 FocusOnPageFocusGained.SelectorSelectedItem="True"    
                                 SelectedIndex="0"
                                 VerticalAlignment="Top"
                                 ScreenReader.Line="{Binding SelectedItem.Text, RelativeSource={RelativeSource Self}}"
                                 ScreenReader.LineType="SelectedItem"
                                 ScreenReader.Event="OnChange"
                                 ScreenReader.SelectedNumber="{Binding SelectedItem.Index, RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=-1}"
                                 ScreenReader.SelectedCount="{Binding Options.Count}">
                        <WrapListBox.Resources>
                            <Thickness x:Key="A_Margin_VirtualizingWrapPanel">0</Thickness>
                        </WrapListBox.Resources>
                    </WrapListBox>
                </StackPanel>
                <ScrollBar x:Name="PART_ScrollBar_GridMenu"
                           HorizontalAlignment="Right"
                           Margin="5,77,0,0"
                           Style="{StaticResource A_Style_ScrollBar_Default}"
                           Minimum="{Binding ScrollWindowMin, ElementName=PART_Menu}"
                           Maximum="{Binding ScrollWindowMax, ElementName=PART_Menu}"
                           Value="{Binding ScrollWindowValue, ElementName=PART_Menu, Mode=TwoWay}"
                           ViewportSize="{Binding ScrollWindowSize, ElementName=PART_Menu}" />
            </StackPanel>
        </Grid>
    </Grid>
</Page>
