<Page xmlns:local="clr-namespace:ForzaUI"
      xmlns:System="clr-namespace:System;assembly=mscorlib"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
      x:Class="ForzaUI.A_DebugCarRestrictionsGenerator"
      mc:Ignorable="d"
      Style="{StaticResource A_Style_Page_Generic}"
      DataContext="{Binding RelativeSource={RelativeSource Self}}"
      FocusManager.FocusedElement="{Binding ElementName=OptionsList}"
      >

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

    <Page.Resources>
        <ResourceDictionary>
            
            <DataTemplate x:Key="A_DataTemplate_ListBoxItem_Setting">
                <local:SpinnerControl Label="{Binding Name}"
                                      Style="{StaticResource A_Style_SpinnerControl_Default}"
                                      ItemsSource="{Binding Options}" SelectedItem="{Binding SelectedValue, Mode=TwoWay}" />
            </DataTemplate>

            <Style x:Key="A_Style_ListBoxItem_TextMenu_Setting" 
                   TargetType="{x:Type ListBoxItem}" 
                   BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_NotFocusable}">
                <Setter Property="Visibility" Value="Visible" />
            </Style>
            
        </ResourceDictionary>
    </Page.Resources>

    <Grid>
        <!-- Background Blur -->
        <local:FZMaterialGlassCapture />
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_Popup_Background}"
                          MinWidth="{Binding ActualWidth, ElementName=MainContent}"
                          MinHeight="{Binding ActualHeight, ElementName=MainContent}"/>

        <local:PlayerBarControl x:Name="TopBar" Style="{StaticResource A_Style_PlayerBarControl}" />
        <ContentControl x:Name="BottomBar" Style="{StaticResource A_Style_ButtonBar}">
            <ContentControl x:Name="DefaultHelpPanel" Style="{StaticResource A_Style_ContentControl_DefaultButtonBar}" />
        </ContentControl>

        <Border Style="{StaticResource A_Style_Border_ScenePadding}" SnapsToDevicePixels="True" UseLayoutRounding="True" >
            <Grid x:Name="LayoutRoot">
                <local:FZTextBlock Text="{Binding DBBlobString}" 
                                   Style="{StaticResource A_Style_FZTextBlock_Heading_Regular}" 
                                   Color="White"
                                   VerticalAlignment="Bottom"
                                   HorizontalAlignment="Right" />
                
                <Grid Style="{StaticResource A_Style_FrameworkElement_ScreenTilt}" Focusable="False" >
                    <StackPanel Orientation="Vertical"
                            VerticalAlignment="Center" 
                            HorizontalAlignment="Center" >
                        <StackPanel Orientation="Horizontal" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
                            <ContentControl Content="CAR RESTRICTIONS GENERATOR"
                                        local:BindingProxy.A="/ForzaUI;component/Textures/Anthem/Icons/Titles/Options.png"
                                        Style="{StaticResource A_Style_ContentControl_ScreenTitleBlock}" />
                        </StackPanel>


                        <DockPanel Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}" VerticalAlignment="Top" >
                            
                            <ContentControl Template="{StaticResource A_ControlTemplate_SidePanel}" 
                                            DockPanel.Dock="Right"
                                            Margin="10,0,0,0"
                                            Tag="WHITE LIST CAR IDS">
                                    <local:FZTextBlock Text="{Binding WhitelistCarIdString}" 
                                                       Style="{StaticResource A_Style_FZTextBlock_Heading_Regular}" 
                                                       TextWrapping="Wrap"
                                                       Color="White" Margin="20" />
                            </ContentControl>

                            <Grid local:UIPageTransitionManager.TransitionIndex="0">
                                <local:CommonListBox x:Name="PART_OptionsList"
                                                    KeyboardNavigation.DirectionalNavigation="Contained" 
                                                    Style="{StaticResource A_Style_ListBox_List_Default}" 
                                                    ItemContainerStyle="{StaticResource A_Style_ListBoxItem_TextMenu_Setting}"
                                                    ItemTemplate="{StaticResource A_DataTemplate_ListBoxItem_Setting}"
                                                    Width="824"
                                                    HorizontalAlignment="Stretch"
                                                    VerticalAlignment="Stretch"
                                                    ItemsSource="{Binding Settings}" />
                            </Grid>

                        </DockPanel>
                    </StackPanel>
                </Grid>
            </Grid>
        </Border>
    </Grid>
</Page>
