<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:local="clr-namespace:ForzaUI;assembly="
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <System:Double x:Key="A_Double_GridMenuItem_Height">40</System:Double>
    <System:Double x:Key="A_Double_GridMenuItem_Width">261</System:Double>
    <System:Double x:Key="A_Double_GridMenuItem_HeightWithMargin">43</System:Double>
    <System:Double x:Key="A_Double_GridMenuItem_WidthWithMargin">264</System:Double>

    <Style x:Key="A_Style_FZMaterial_GridMenuEmptyItem"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}">
        <Setter Property="Color" Value="{StaticResource A_Color_GlassPanel_Interactive}"/>
        <Setter Property="Height" Value="{StaticResource A_Double_GridMenuItem_Height}"/>
        <Setter Property="Width" Value="{StaticResource A_Double_GridMenuItem_Width}"/>
        <Setter Property="Margin" Value="0,0,3,0"/>
    </Style>

    <Style x:Key="A_Style_ListBoxItem_GridMenu_Default"
                   BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_Default}"
                   TargetType="{x:Type ListBoxItem}">
        <Setter Property="Visibility"
                        Value="Visible" />
        <Setter Property="Width"
                        Value="{StaticResource A_Double_GridMenuItem_Width}" />
        <Setter Property="Height"
                        Value="{StaticResource A_Double_GridMenuItem_Height}" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_GridMenuItemText"
                BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}"
                TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Setter Property="Margin" Value="0"/>
        <Setter Property="FontFamily" Value="Anthem_A"/>
        <Setter Property="CapHeight" Value="16"/>
    </Style>

    <DataTemplate x:Key="A_DataTemplate_ListBoxItem_GridMenuItem">
        <local:FZTextBlock Text="{Binding Text, Converter={StaticResource A_StringToUpper}}"
                    Style="{StaticResource A_Style_FZTextBlock_GridMenuItemText}"/>
    </DataTemplate>

    <Style x:Key="A_Style_ListBox_GridMenu"
                BasedOn="{StaticResource A_Style_ListBox_TextMenu}"
                TargetType="{x:Type local:GridListBox}">
        <Setter Property="ItemContainerStyle" Value="{StaticResource A_Style_ListBoxItem_GridMenu_Default}"/>
        <Setter Property="ItemTemplate" Value="{StaticResource A_DataTemplate_ListBoxItem_GridMenuItem}"/>
        <Setter Property="MaxHeight" Value="642"/>
        <Setter Property="Width" Value="1320"/>
        <Setter Property="AllowMouseWheelScrolling" Value="False"/>
        <Setter Property="MinHeight" Value="{StaticResource A_Double_GridMenuItem_HeightWithMargin}"/>
        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Contained"/>
        <Setter Property="FocusManager.IsFocusScope" Value="True"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBox}">
                    <Grid>
                        <StackPanel x:Name="EmptyItemsContainer"
                                    VerticalAlignment="Bottom"
                                    Orientation="Horizontal"
                                    Margin="1.5,0,0,3">
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GridMenuEmptyItem}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GridMenuEmptyItem}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GridMenuEmptyItem}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GridMenuEmptyItem}"/>
                            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GridMenuEmptyItem}"/>
                        </StackPanel>
                        <local:FZScrollViewer Style="{StaticResource A_Style_ScrollViewer_TextMenu}"
                                              Template="{StaticResource A_ControlTemplate_ScrollViewer_Popup_ExternalRightPosition}"
                                              CanContentScroll="True"
                                              HorizontalScrollBarVisibility="Disabled"
                                              VerticalScrollBarVisibility="{Binding Path=(ScrollViewer.VerticalScrollBarVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                                              local:FZScrollViewer.IsAtTop="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtTop), Mode=OneWayToSource}"
                                              local:FZScrollViewer.IsAtBottom="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=(local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource}"
                                              Focusable="False"
                                              KeepSelectionOnScreen="True"
                                              VerticalAlignment="Top"
                                              x:Name="ScrollViewer"
                                              Margin="-18,0"
                                              HandleDirectionalInput="False"
                                              >
                            <WrapPanel Orientation="Horizontal"
                                IsItemsHost="True"
                                ItemWidth="{StaticResource A_Double_GridMenuItem_WidthWithMargin}"
                                ItemHeight="{StaticResource A_Double_GridMenuItem_HeightWithMargin}"
                                Focusable="False"
                                Margin="18,0"/>
                        </local:FZScrollViewer>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding ComputedVerticalScrollBarVisibility, ElementName=ScrollViewer}" Value="{x:Static Visibility.Visible}">
                            <Setter Property="Margin" TargetName="EmptyItemsContainer" Value="1.5,0,0,0"/>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>