<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Color
        x:Key="A_Color_Scrollbar_Background">#33F5F5F5</Color>
    <Color
        x:Key="A_Color_Scrollbar_Foreground">#FFCDCDCD</Color>
    <Style
        TargetType="Thumb">
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="Thumb">
                    <Grid
                        x:Name="Grid">
                        <Border
                            x:Name="Rectangle1"
                            CornerRadius="0"
                            Background="{TemplateBinding Background}" />
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger
                            Property="Tag"
                            Value="Horizontal">
                            <Setter
                                TargetName="Rectangle1"
                                Property="Width"
                                Value="Auto" />
                            <Setter
                                TargetName="Rectangle1"
                                Property="Height"
                                Value="6" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Style
        TargetType="ScrollBar"
        BasedOn="{StaticResource A_Style_FrameworkElement_DefaultTransition_0}">
        <Setter
            Property="Foreground">
            <Setter.Value>
                <SolidColorBrush
                    Color="{StaticResource A_Color_Scrollbar_Foreground}" />
            </Setter.Value>
        </Setter>
        <Setter
            Property="Background">
            <Setter.Value>
                <SolidColorBrush
                    Color="{StaticResource A_Color_Scrollbar_Background}" />
            </Setter.Value>
        </Setter>
        <Setter
            Property="Width"
            Value="6" />
        <Setter
            Property="Template">
            <Setter.Value>
                <ControlTemplate
                    TargetType="ScrollBar">
                    <Grid
                        x:Name="GridRoot"
                        Width="6"
                        Margin="-90,0,0,0">
                        <Border
                            x:Name="TrackBackground"
                            CornerRadius="0"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Stretch"
                            Width="4"
                            Height="Auto"
                            Background="{TemplateBinding Background}" />
                        <Track
                            x:Name="PART_Track"
                            Grid.Row="0"
                            IsDirectionReversed="true"
                            Focusable="false"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch"
                            Width="Auto"
                            Height="Auto">
                            <Track.Thumb>
                                <Thumb
                                    x:Name="Thumb"
                                    Background="{TemplateBinding Foreground}" />
                            </Track.Thumb>
                        </Track>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger
                            Property="IsEnabled"
                            Value="false">
                            <Setter
                                TargetName="Thumb"
                                Property="Visibility"
                                Value="Collapsed" />
                        </Trigger>
                        <Trigger
                            Property="Orientation"
                            Value="Horizontal">
                            <Setter
                                TargetName="GridRoot"
                                Property="LayoutTransform">
                                <Setter.Value>
                                    <RotateTransform
                                        Angle="-90" />
                                </Setter.Value>
                            </Setter>
                            <Setter
                                TargetName="PART_Track"
                                Property="LayoutTransform">
                                <Setter.Value>
                                    <RotateTransform
                                        Angle="-90" />
                                </Setter.Value>
                            </Setter>
                            <Setter
                                Property="Width"
                                Value="Auto" />
                            <Setter
                                Property="Height"
                                Value="6" />
                            <Setter
                                TargetName="TrackBackground"
                                Property="Width"
                                Value="Auto" />
                            <Setter
                                TargetName="TrackBackground"
                                Property="Height"
                                Value="4" />
                            <Setter
                                TargetName="Thumb"
                                Property="Tag"
                                Value="Horizontal" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    <Thickness x:Key="A_Thickness_ScrollViewer_TextMenu_Margin_Dynamic">-18,0,-18,0</Thickness>
    <Style
        x:Key="A_Style_ScrollViewer_TextMenu"
        TargetType="ScrollViewer">
        <Setter
            Property="Margin"
            Value="{DynamicResource A_Thickness_ScrollViewer_TextMenu_Margin_Dynamic}" />
    </Style>
    <Thickness
        x:Key="A_Thickness_ListBox_TextMenu_PanelMargin_Dynamic">18,0,18,0</Thickness>
    <ControlTemplate
        x:Key="A_ControlTemplate_ListBox_TextMenu_Default"
        TargetType="{Type ListBox}">
        <DockPanel>
            <FZScrollViewer
                DockPanel.Dock="Top"
                Style="{StaticResource A_Style_ScrollViewer_TextMenu}"
                Template="{StaticResource A_ControlTemplate_ScrollViewer_TextMenu}"
                CanContentScroll="True"
                HorizontalScrollBarVisibility="Disabled"
                VerticalScrollBarVisibility="{Binding (ScrollViewer.VerticalScrollBarVisibility), RelativeSource={RelativeSource TemplatedParent}}"
                IsAtTop="{Binding (local:FZScrollViewer.IsAtTop), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                IsAtBottom="{Binding (local:FZScrollViewer.IsAtBottom), Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}"
                Focusable="False"
                KeepSelectionOnScreen="True"
				DragMovementMultiplier="0.03"
                VerticalAlignment="Top"
                x:Name="ScrollViewer">
                <VirtualizingStackPanel
                    Margin="{DynamicResource A_Thickness_ListBox_TextMenu_PanelMargin_Dynamic}"
                    Orientation="Vertical"
                    IsItemsHost="True"
                    VirtualizationMode="Recycling"
                    Focusable="False" />
            </FZScrollViewer>
            <StackPanel
                ClipToBounds="True"
                x:Name="EmptyItems">
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
                <FZMaterial
                    Style="{StaticResource A_Style_FZMaterial_TextMenuEmptyItem}"
                    Margin="0,0,0,3" />
            </StackPanel>
        </DockPanel>
        <ControlTemplate.Triggers>
            <Trigger
                Property="Height"
                Value="auto">
                <Setter
                    TargetName="EmptyItems"
                    Property="Visibility"
                    Value="Collapsed" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style
        x:Key="A_Style_ListBox_TextMenu"
        TargetType="{Type local:CommonListBox}">
        <Setter
            Property="FocusVisualStyle"
            Value="{Null}" />
        <Setter
            Property="AlternationCount"
            Value="10000" />
        <Setter
            Property="ScrollViewer.VerticalScrollBarVisibility"
            Value="Auto" />
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_ListBox_TextMenu_Default}" />
    </Style>
   
    <UIStoryboard
        x:Key="A_StoryBoard_TextMenu_Focus"
        DurationOverride="{StaticResource A_Duration_Button_Select}">
        <Int32AnimationUsingKeyFrames
            Storyboard.TargetProperty="(local:ZPanel.ClippingBias)">
            <DiscreteInt32KeyFrame
                KeyTime="0:0:0.0"
                Storyboard.TargetName="BackgroundMaterial"
                Value="1" />
        </Int32AnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
            Storyboard.TargetName="Background">
            <DiscreteDoubleKeyFrame
                KeyTime="0:0:0"
                Value="1" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
            Storyboard.TargetName="Background">
            <DiscreteDoubleKeyFrame
                KeyTime="0:0:0"
                Value="1" />
        </DoubleAnimationUsingKeyFrames>
    </UIStoryboard>
    <UIStoryboard
        x:Key="A_StoryBoard_TextMenu_Blur"
        DurationOverride="{StaticResource A_Duration_Button_Select}">
        <Int32AnimationUsingKeyFrames
            Storyboard.TargetProperty="(local:ZPanel.ClippingBias)">
            <DiscreteInt32KeyFrame
                KeyTime="0:0:0.0"
                Storyboard.TargetName="BackgroundMaterial"
                Value="1" />
            <DiscreteInt32KeyFrame
                KeyTime="0:0:0.0"
                Value="{x:Static System:Int32.MaxValue}" />
        </Int32AnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"
            Storyboard.TargetName="Background">
            <EasingDoubleKeyFrame
                KeyTime="0:0:0.0"
                Value="1.0"
                EasingFunction="{CircleEasing}" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames
            Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
            Storyboard.TargetName="Background">
            <EasingDoubleKeyFrame
                KeyTime="0:0:0.0"
                Value="1.0"
                EasingFunction="{CircleEasing}" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames
            Storyboard.TargetProperty="(local:ZPanel.ZOffset)"
            Storyboard.TargetName="Background">
            <EasingDoubleKeyFrame
                KeyTime="0:0:0.0"
                Value="0"
                EasingFunction="{CircleEasing}" />
        </DoubleAnimationUsingKeyFrames>
    </UIStoryboard>
    <Style
        x:Key="A_Style_FZMaterial_TextMenuItemShadow"
        TargetType="{Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase}">
        <Setter
            Property="Preset">
            <Setter.Value>
                <FZMaterialPresetSelfShadow
                    Softness="20" />
            </Setter.Value>
        </Setter>
    </Style>
    <Style
        TargetType="local:FZMaterial"
        x:Key="A_Style_FZMaterial_TextMenu_LockIcon">
        <Setter
            Property="Width"
            Value="30" />
        <Setter
            Property="Height"
            Value="34" /> 
        <Setter
            Property="ImageSourceNoPreload"
            Value="/ForzaUI;component/Textures/Anthem/Icons/Pad_Lock.png" />
        <Setter
            Property="HorizontalAlignment"
            Value="Right" />
        <Setter
            Property="VerticalAlignment"
            Value="Center" />
        <Setter
            Property="Color"
            Value="{StaticResource A_Color_TextMenu_Text_Default}" />
        <Style.Triggers>
            <DataTrigger
                Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}"
                Value="True">
                <Setter
                    Property="Color"
                    Value="{StaticResource A_Color_TextMenu_Text_Highlighted}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Double
        x:Key="A_Double_TextMenu_Height_Default">50</Double>
    <FZMaterialPresetGlassRoundtangle
        x:Key="A_FZMaterialPresetGlassRoundtangle_EmptyItem"
        BasedOn="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_Base}"
        CornerRadius="{StaticResource H_CornerRadius_All_2px}"
        GlassColor="#ffffffff"
        BlurAmount="High" />
    <Style
        x:Key="A_Style_FZMaterial_TextMenuEmptyItem"
        TargetType="{Type local:FZMaterial}">
        <Setter
            Property="Focusable"
            Value="False" />
        <Setter
            Property="Height"
            Value="{StaticResource A_Double_TextMenu_Height_Default}" />
        <Setter
            Property="Color"
            Value="#00000000" />
        <Setter
            Property="Preset"
            Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_EmptyItem}" />
    </Style>
    <MappingConverter
        x:Key="A_Converter_IsNotNull"
        Default="{StaticResource A_Boolean_True}">
        <MappingConverterEntry
            Key="{Null}"
            Value="{StaticResource A_Boolean_False}" />
    </MappingConverter>
    <ControlTemplate
        x:Key="A_ControlTemplate_TextMenu_WithDropShadow"
        TargetType="ListBoxItem">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_RoutedEventCommand_MouseLeftButtonUp"
                    TargetType="local:RoutedEventCommand">
                    <Setter
                        Property="Command"
                        Value="{Binding ItemFuncCommand}" />
                    <Style.Triggers>
                        <DataTrigger
                            Binding="{Binding ItemFuncCommand}"
                            Value="{Null}">
                            <Setter
                                Property="Command"
                                Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType={Type Page}}}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <Storyboard x:Key="TextMenu_ControlTemplate_ItemSelected">
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(ZPanel.ClippingBias)">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="1" />
                    </Int32AnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="DropShadow">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="0.6" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                   Storyboard.TargetName="ShadowScale">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="1.0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                                                   Storyboard.TargetName="ShadowScale">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="1.0" />
                    </DoubleAnimationUsingKeyFrames>
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)"
                                                  Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=ContentPresenter}}">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="20" />
                    </Int32AnimationUsingKeyFrames>
                </Storyboard>
                <UIStoryboard x:Key="TextMenu_ControlTemplate_ItemDeselected"
                              Duration="0:0:0.36">
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(ZPanel.ClippingBias)">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="1" />
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.3"
                                               Value="{x:Static Int32.MaxValue}" />
                    </Int32AnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="DropShadow">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                   Storyboard.TargetName="ShadowScale">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0.75"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                                                   Storyboard.TargetName="ShadowScale">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0.75"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)"
                                                  Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=ContentPresenter}}">
                        <EasingInt32KeyFrame KeyTime="0:0:0.3"
                                             Value="0"
                                             EasingFunction="{CircleEasing}" />
                    </Int32AnimationUsingKeyFrames>
                </UIStoryboard>
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid x:Name="OuterContainer">
            <FZMaterial x:Name="DropShadow"
                        Margin="24,-24,24,-24"
                        Style="{DynamicDataBinding DropShadowStyle, FallbackValue={StaticResource H_Style_FZMaterial_ShadowBase_ForSubgraph}}">
                <FZMaterial.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform
                                        ScaleX="0"
                                        ScaleY="0"
                                        x:Name="ShadowScale" />
                    </TransformGroup>
                </FZMaterial.RenderTransform>
            </FZMaterial>
            <Grid
                x:Name="Background"
                RenderTransformOrigin="0.5,0.5">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </Grid.RenderTransform>
                <RoutedEventCommand
                    x:Name="MouseLeftButtonUpCommand"
                    RoutedEvent="UIElement.MouseLeftButtonUp"
                    Style="{StaticResource A_Style_RoutedEventCommand_MouseLeftButtonUp}" />
                <FZMaterial
                    x:Name="BackgroundMaterial"
                    RoutedEventCommand.Action="{Binding ElementName=MouseLeftButtonUpCommand}"
                    Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"
                    Preset="{StaticResource H_Roundtangle_Outer_2px}"
                    Color="{StaticResource H_Color_Primary_White}" />
                <ContentPresenter
                    Focusable="{Binding Focusable, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                    x:Name="Presenter"
                    PropertySetter.Value="{Binding IsKeyboardFocused, RelativeSource={RelativeSource Self}}"
                    PropertySetter.Property="Content.(FocusSelf.WhenTrue)"/>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard x:Name="ShowItemSelected_BeginStoryboard"
                                    HandoffBehavior="SnapshotAndReplace"
                                    Storyboard="{StaticResource TextMenu_ControlTemplate_ItemSelected}" />
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="HideItemSelected_BeginStoryboard"
                                    HandoffBehavior="SnapshotAndReplace"
                                    Storyboard="{StaticResource TextMenu_ControlTemplate_ItemDeselected}" />
                </Trigger.ExitActions>
            </Trigger>
            <Trigger
                Property="IsKeyboardFocused"
                Value="True">
                <Setter
                    TargetName="Presenter"
                    Property="FocusSelf.WhenTrue"
                    Value="True" />
            </Trigger>
            <Trigger
                Property="Tag"
                Value="GroupHeader">
                <Setter
                    Property="Visibility"
                    TargetName="BackgroundMaterial"
                    Value="Collapsed" />
            </Trigger>
            <Trigger
                Property="Tag"
                Value="Inactive">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Preset"
                    Value="{StaticResource H_GlassRoundtangle_2px}" />
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Color"
                    Value="{StaticResource H_Color_Glass_Purple_20pc}" />
            </Trigger>
            <Trigger
                Property="IsEnabled"
                Value="False">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Opacity"
                    Value="0.3" />
            </Trigger>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard4"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Focus}" />
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard3"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Blur}" />
                </Trigger.ExitActions>
                <Setter
                    Property="Color"
                    TargetName="BackgroundMaterial"
                    Value="{StaticResource H_Color_HighlightedItemBg}" />
                <Setter
                    Property="Visibility"
                    TargetName="DropShadow"
                    Value="Visible" />
            </Trigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}"
                        Value="True" />
                    <Condition
                        Binding="{Binding (ItemContainerGenerator.ItemForItemContainer), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_IsNotNull}}"
                        Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter
                    Property="IsSelected"
                    Value="True" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding Focusable, RelativeSource={RelativeSource Self}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Tag, RelativeSource={RelativeSource Self}}"
                        Value="{Null}" />
                </MultiDataTrigger.Conditions>
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Visibility"
                    Value="Collapsed" />
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_ContentPresenter_TextMenu_Default" TargetType="ContentPresenter">
        <!--Focusable must be always False when not focused on a ListBoxItem, otherwise buttons won't work on TiledMenus which rely on focusing directly on FZButtons-->
        <Setter Property="Focusable" Value="{Binding Focusable, Mode=OneWay, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}},FallbackValue=False}" />
    </Style>

    <ControlTemplate
        x:Key="A_ControlTemplate_TextMenu_Default"
        TargetType="ContentControl">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_RoutedEventCommand_MouseLeftButtonUp"
                    TargetType="local:RoutedEventCommand">
                    <Setter
                        Property="Command"
                        Value="{Binding ItemFuncCommand}" />
                    <Style.Triggers>
                        <DataTrigger
                            Binding="{Binding ItemFuncCommand}"
                            Value="{Null}">
                            <Setter
                                Property="Command"
                                Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType={Type Page}}}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid>
            <FZMaterial x:Name="SelectedShadow"
                        Style="{StaticResource H_Style_Selected_Shadow}"
                        ZPanel.DisableClipping="True"/>
            <Grid
                x:Name="Background"
                RenderTransformOrigin="0.5,0.5"
                Style="{StaticResource A_Style_OptInMotionBlur}">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <!-- No scaling highlighted elements anymore -->
                        <!-- <ScaleTransform /> -->
                        <SkewTransform />
                        <RotateTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </Grid.RenderTransform>
                <RoutedEventCommand
                    x:Name="MouseLeftButtonUpCommand"
                    RoutedEvent="UIElement.MouseLeftButtonUp"
                    Style="{StaticResource A_Style_RoutedEventCommand_MouseLeftButtonUp}" />
                <FZMaterial
                    x:Name="BackgroundMaterial"
                    RoutedEventCommand.Action="{Binding ElementName=MouseLeftButtonUpCommand}"
                    Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"
                    Preset="{StaticResource H_Roundtangle_Outer_2px}"
                    Color="{StaticResource H_Color_Primary_White}" />
                <ContentPresenter Style="{StaticResource A_Style_ContentPresenter_TextMenu_Default}"
                    x:Name="Presenter"
                    PropertySetter.Value="{Binding IsKeyboardFocused, RelativeSource={RelativeSource Self}}"
                    PropertySetter.Property="Content.(FocusSelf.WhenTrue)"/>
                <StrokeHighlightControl Style="{StaticResource H_Style_StrokeHighlight_Instant_TextMenu}"
                    ContentRadius="2"
                    IsEnabled="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource TemplatedParent}}"/>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger
                Property="IsKeyboardFocused"
                Value="True">
                <Setter
                    TargetName="Presenter"
                    Property="FocusSelf.WhenTrue"
                    Value="True" />
            </Trigger>
            <Trigger
                Property="Tag"
                Value="GroupHeader">
                <Setter
                    Property="Visibility"
                    TargetName="BackgroundMaterial"
                    Value="Collapsed" />
            </Trigger>
            <Trigger
                Property="Tag"
                Value="Inactive">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Preset"
                    Value="{StaticResource H_GlassRoundtangle_2px}" />
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Color"
                    Value="{StaticResource H_Color_Glass_Purple_40pc}" />
            </Trigger>
            <Trigger
                Property="IsEnabled"
                Value="False">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Preset"
                    Value="{StaticResource H_GlassRoundtangle_2px}" />
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Color"
                    Value="{StaticResource H_Color_Glass_Purple_40pc}" />
            </Trigger>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard1"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Focus}" />
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard2"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Blur}" />
                </Trigger.ExitActions>
                <Setter
                    Property="Color"
                    TargetName="BackgroundMaterial"
                    Value="{StaticResource H_Color_HighlightedItemBg}" />
                <Setter
                    Property="Opacity"
                    TargetName="SelectedShadow"
                    Value="1"/>
            </Trigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}"
                        Value="True" />
                    <Condition
                        Binding="{Binding (ItemContainerGenerator.ItemForItemContainer), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_IsNotNull}}"
                        Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter
                    Property="Selector.IsSelected"
                    Value="True" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding Focusable, RelativeSource={RelativeSource Self}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Tag, RelativeSource={RelativeSource Self}}"
                        Value="{Null}" />
                </MultiDataTrigger.Conditions>
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Visibility"
                    Value="Collapsed" />
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <Style
        x:Key="A_Style_ListBoxItem_TextMenu"
        TargetType="{Type ListBoxItem}"
        BasedOn="{StaticResource A_Style_FrameworkElement_DefaultTransition}">
        <Style.Triggers>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Setter
                    Property="Panel.ZIndex"
                    Value="1" />
            </Trigger>
            <DataTrigger
                Binding="{Binding Content.Visibility, RelativeSource={RelativeSource Self}}"
                Value="{x:Static Visibility.Collapsed}">
                <Setter
                    Property="Visibility"
                    Value="Collapsed" />
            </DataTrigger>
        </Style.Triggers>
        <Setter
            Property="FocusVisualStyle"
            Value="{Null}" />
        <Setter
            Property="Margin"
            Value="0,0,0,3" />
        <Setter
            Property="Focusable"
            Value="True" />
        <Setter
            Property="local:UIPageTransitionManager.TransitionIndex"
            Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource Self}}" />
    </Style>
    <Style
        x:Key="A_Style_Run_TextMenu_BOLD"
        TargetType="local:FZRun">
        <Setter
            Property="FontFamily"
            Value="Horizon_A" />
    </Style>
    <Style
        x:Key="A_Style_Run_TextMenu_SUPERSCRIPT"
        TargetType="local:FZRun">
        <Setter
            Property="SubscriptScale"
            Value="-0.75" />
        <Setter Property="Converter"
                Value="{StaticResource A_StringToLower}" />
    </Style>

    <Style
        x:Key="A_Style_FZTextBlock_OptionText_Heading"
        BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}"
        TargetType="local:FZTextBlock">
        <Setter Property="CapHeight" Value="18" />
        <Setter Property="FontFamily" Value="Horizon_B" />
        <Setter Property="Margin" Value="19,0,0,0" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding Tag, RelativeSource={RelativeSource FindAncestor, AncestorType=ContentControl}}" Value="Inactive">
                <Setter Property="Opacity" Value="0.6"/>
                <Setter Property="Color" Value="{StaticResource A_Color_White}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style
        x:Key="A_Style_FZRun_TextMenu_CREDITS" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Control Style="{StaticResource H_Style_Control_CreditsIcon}" Margin="0, -4, 0, -4"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="A_Style_FZRun_TextMenu_DISCOVER_JAPAN" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Control Style="{StaticResource H_Style_Control_DJIcon}" Margin="0, -4, 0, -4"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style
        x:Key="A_Style_FZRun_TextMenu_HORIZON_POINTS" TargetType="Control">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Control Style="{StaticResource H_Style_Control_FPIcon}" Margin="0, -4, 0, -4"/>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <MappingConverter x:Key="A_MappingConverter_TextMenu" >
        <MappingConverterEntry Key="{NoCase BOLD}" Value="{StaticResource A_Style_Run_TextMenu_BOLD}" />
        <MappingConverterEntry Key="{NoCase SUPERSCRIPT}" Value="{StaticResource A_Style_Run_TextMenu_SUPERSCRIPT}" />
        <MappingConverterEntry Key="{NoCase CREDITS}" Value="{StaticResource A_Style_FZRun_TextMenu_CREDITS}" />
        <MappingConverterEntry Key="{NoCase DJ}" Value="{StaticResource A_Style_FZRun_TextMenu_DISCOVER_JAPAN}" />
        <MappingConverterEntry Key="{NoCase HP}" Value="{StaticResource A_Style_FZRun_TextMenu_HORIZON_POINTS}" />
    </MappingConverter>

    <AutoScrollSettings x:Key="A_AutoScrollSettings_OptionText" 
        InitialPause="0:0:0.5"
        Speed="40.0"
        ScrollOrientation="Horizontal"/>
    <Style x:Key="A_Style_FZTextBlock_AutoScroll_OptionText" BasedOn="{StaticResource A_Style_FZTextBlock_OptionText}" TargetType="FZTextBlock">
        <Setter Property="AutoScroll" Value="{StaticResource A_AutoScrollSettings_OptionText}" />
        <Setter Property="AutoScroll.AllowScrolling" Value="True" />
        <Setter Property="TextTrimming" Value="WordEllipsis"/>
        <Setter Property="MaxWidth" Value="630"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="TextAlignment" Value="Center"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource FindAncestor, AncestorType=ListBoxItem}}" Value="True">
                <Setter Property="Color" Value="{StaticResource A_Color_ListItemText_Focused}" />
                <Setter Property="MaxWidth" Value="infinity"/>
                <Setter Property="TextTrimming" Value="None" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <DataTemplate
        x:Key="A_DataTemplate_TextMenu_Default">
        <StackPanel
            x:Name="ButtonContent"
            HorizontalAlignment="Center"
            Orientation="Horizontal"
            VerticalAlignment="Center"
            IsHitTestVisible="False"
            Height="{StaticResource A_Double_TextMenu_Height_Default}">
                <FZMaterial x:Name="Icon"
                            ImageSourceNoPreload="{Binding IconPath}"
                            Width="40"
                            Height="40"
                            Margin="20,0,0,0"
                            HorizontalAlignment="Left"
                            Color="{StaticResource H_Color_Primary_Purple}"
                            Visibility="{Binding IconPath, Converter={StaticResource A_StringVisConverter}, FallbackValue=Collapsed}"/>

                    <FZTextBlock 
                            x:Name="AutoScrollTextBlock"
                            Style="{StaticResource A_Style_FZTextBlock_AutoScroll_OptionText}"
                            Text="{Binding Text}"
                            ScreenReader.Event="OnChange"
                            ScreenReader.ControlType="Button"
                            ScreenReader.LineType="SelectedItem"
                            ScreenReader.SelectedNumber="{Binding (ItemsControl.AlternationIndex), FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type ListBoxItem}}, Converter={StaticResource A_IndexToNumberConverter}}"
                            ScreenReader.SelectedCount="{Binding Items.Count, FallbackValue=0, RelativeSource={RelativeSource AncestorType={Type Selector}}}"
                            MarkupConverter="{StaticResource A_MappingConverter_TextMenu}"/>
        </StackPanel>
        <DataTemplate.Triggers>
            <DataTrigger
                Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                Value="True">
                <Setter
                    TargetName="AutoScrollTextBlock"
                    Property="local:ScreenReader.Line"
                    Value="{Binding Text, Converter={StaticResource A_Converter_TrimInlineMarkup}}" />
                <Setter
                    TargetName="Icon"
                    Property="Color"
                    Value="{StaticResource H_Color_Primary_White}"/>
            </DataTrigger>
            <DataTrigger
                Binding="{Binding ElementName=Icon, Path=Visibility}"
                Value="{x:Static Visibility.Visible}">
                <Setter
                    TargetName="ButtonContent"
                    Property="HorizontalAlignment"
                    Value="Left"/>
            </DataTrigger>
        </DataTemplate.Triggers>
    </DataTemplate>
    <Style
        x:Key="A_Style_ListBoxItem_TextMenu_Default"
        BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu}"
        TargetType="{Type ListBoxItem}">
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_TextMenu_Default}" />
        <Setter
            Property="local:FocusOnMouseOverBehaviour.Self"
            Value="True" />
        <Setter
            Property="Margin"
            Value="0,2,0,2" />
    </Style>
    <Style
        x:Key="A_Style_ListBoxItem_TextMenu_NotFocusable"
        BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu}"
        TargetType="ListBoxItem">
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_TextMenu_Default}" />
        <Setter
            Property="local:FocusOnMouseOverBehaviour.Self"
            Value="True" />
        <Style.Triggers>
            <Trigger
                Property="Tag"
                Value="GroupHeader">
                <Setter
                    Property="Focusable"
                    Value="False" />
            </Trigger>
        </Style.Triggers>
    </Style>
    <Style
        x:Key="A_Style_ListBox_TextMenu_Default"
        TargetType="{Type local:CommonListBox}"
        BasedOn="{StaticResource A_Style_ListBox_TextMenu}">
        <Setter
            Property="ItemContainerStyle"
            Value="{StaticResource A_Style_ListBoxItem_TextMenu_Default}" />
        <Setter
            Property="ItemTemplate"
            Value="{StaticResource A_DataTemplate_TextMenu_Default}" />
    </Style>
    <Style
        BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu}"
        TargetType="{Type ListBoxItem}"
        x:Key="A_Style_ListBoxItem_TextMenu_Gaps">
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_TextMenu_Default}" />
         <Setter
            Property="FocusSelf.WhenTrue"
            Value="{Binding (Selector.IsSelected), RelativeSource={RelativeSource Self}}" /> 
        <Setter
            Property="local:FocusOnMouseOverBehaviour.Self"
            Value="True" />
        <Setter
            Property="Margin"
            Value="0,2,0,2" />
    </Style>
    <Style
        BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu}"
        TargetType="{Type ListBoxItem}"
        x:Key="A_Style_ListBoxItem_TextMenu_NoGaps">
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_TextMenu_Default}" />
        <Setter
            Property="local:FocusOnMouseOverBehaviour.Self"
            Value="True" />
        <Setter
            Property="local:FocusSelf.WhenTrue"
            Value="{Binding (Selector.IsSelected), Mode=OneWay, RelativeSource={RelativeSource Self}}" />
        <Setter
            Property="Margin"
            Value="0,0,0,0" />
    </Style>
    <Style
        BasedOn="{StaticResource A_Style_ListBoxItem_TextMenu_NoGaps}"
        TargetType="{Type ListBoxItem}"
        x:Key="A_Style_ListBoxItem_TextMenu_NoGaps_WithDropShadow">
        <Setter
            Property="Template"
            Value="{StaticResource A_ControlTemplate_TextMenu_WithDropShadow}" />
    </Style>
    <Style
        x:Key="A_Style_ScrollBar_TextMenu"
        BasedOn="{StaticResource A_Style_ScrollBar_Default}"
        TargetType="{Type ScrollBar}" />
    <ControlTemplate
        x:Key="A_ControlTemplate_ScrollViewer_TextMenu"
        TargetType="ScrollViewer">
        <Grid>
            <ScrollBar
                x:Name="PART_VerticalScrollBar"
                HorizontalAlignment="Right"
                Minimum="0"
                Maximum="{TemplateBinding ScrollableHeight}"
                ViewportSize="{TemplateBinding ViewportHeight}"
                Value="{TemplateBinding VerticalOffset}"
                Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}"
                Style="{StaticResource A_Style_ScrollBar_TextMenu}" />
            <ScrollContentPresenter
                x:Name="PART_ScrollContentPresenter"
                Content="{TemplateBinding Content}"
                CanContentScroll="{TemplateBinding ScrollViewer.CanContentScroll}"
                ClipToBounds="True" />
        </Grid>
    </ControlTemplate>
    <Style
        x:Key="A_Style_ListBox_List_Default"
        BasedOn="{StaticResource A_Style_ListBox_TextMenu}"
        TargetType="{Type local:CommonListBox}">
        <Setter
            Property="ItemTemplate"
            Value="{Null}" />
        <Setter
            Property="Height"
            Value="663" />
    </Style>
    <Style
        x:Key="A_Style_ListBox_List_Default_ScrollBar"
        TargetType="{Type local:CommonListBox}"
        BasedOn="{StaticResource A_Style_ListBox_List_Default}">
        <Setter
            Property="ScrollViewer.VerticalScrollBarVisibility"
            Value="{x:Static ScrollBarVisibility.Visible}" />
        <Setter
            Property="AllowMouseWheelScrolling"
            Value="False" />
        <Setter
            Property="Margin"
            Value="0,0,18,0" />
    </Style>
    <Style
        x:Key="A_Style_FZTextBlock_SpinnerItem"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}"
        TargetType="local:FZTextBlock">
        <Setter
            Property="Color"
            Value="{StaticResource A_Color_TextMenu_Text_Default}" />
        <Setter
            Property="VerticalAlignment"
            Value="Center" />
        <Setter
            Property="TextAlignment"
            Value="Center" />
        <Setter
            Property="Margin"
            Value="0" />
        <Setter
            Property="Stretch"
            Value="Uniform" />
        <Setter
            Property="StretchDirection"
            Value="DownOnly" />
        <Setter
            Property="CapHeight"
            Value="19" />
    </Style>
    <ControlTemplate
        x:Key="A_ControlTemplate_Button_TextMenu"
        TargetType="local:FZButton">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_FZTextBlock_ButtonText_Dynamic"
                    TargetType="local:FZTextBlock"
                    BasedOn="{StaticResource A_Style_FZTextBlock_SpinnerItem}">
                    <Setter
                        Property="HorizontalAlignment"
                        Value="Center" />
                    <Setter
                        Property="VerticalAlignment"
                        Value="Center" />
                </Style>
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid
            Height="{StaticResource A_Double_TextMenu_Height_Default}">
            <Viewbox
                Stretch="Fill">
                <FZMaterial
                    Width="1"
                    Height="1"
                    Color="#00000000"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" />
            </Viewbox>
            <Grid
                IsHitTestVisible="False"
                Height="{StaticResource A_Double_TextMenu_Height_Default}">
                <FZTextBlock
                    x:Name="ButtonText"
                    Text="{TemplateBinding Content}"
                    Style="{DynamicResource A_Style_FZTextBlock_ButtonText_Dynamic}" />
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Setter
                    Property="Color"
                    TargetName="ButtonText"
                    Value="{StaticResource A_Color_TextMenu_Text_Highlighted}" />
            </Trigger>
            <DataTrigger
                Binding="{Binding IsEnabled, FallbackValue=True, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                Value="False">
                <Setter
                    Property="Color"
                    TargetName="ButtonText"
                    Value="{StaticResource A_Color_TextMenu_Text_Locked}" />
            </DataTrigger>
            <Trigger
                Property="IsEnabled"
                Value="False">
                <Setter
                    Property="Color"
                    TargetName="ButtonText"
                    Value="{StaticResource A_Color_TextMenu_Text_Locked}" />
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    <ControlTemplate
        x:Key="A_ControlTemplate_Button_ToItemSelect_TextMenu"
        TargetType="local:FZButton">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_FZTextBlock_ButtonText_Dynamic"
                    TargetType="local:FZTextBlock"
                    BasedOn="{StaticResource A_Style_FZTextBlock_SpinnerItem}">
                    <Setter
                        Property="HorizontalAlignment"
                        Value="Center" />
                    <Setter
                        Property="VerticalAlignment"
                        Value="Center" />
                </Style>
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid
            Height="{StaticResource A_Double_TextMenu_Height_Default}">
            <Viewbox
                Stretch="Fill">
                <FZMaterial
                    Width="1"
                    Height="1"
                    Color="#00000000"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch" />
            </Viewbox>
            <Grid
                IsHitTestVisible="False"
                Height="{StaticResource A_Double_TextMenu_Height_Default}">
                <ContentPresenter />
            </Grid>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="H_ControlTemplate_TileList_HighlightStroke"
                     TargetType="ListBoxItem">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_RoutedEventCommand_MouseLeftButtonUp"
                    TargetType="local:RoutedEventCommand">
                    <Setter
                        Property="Command"
                        Value="{Binding ItemFuncCommand}" />
                    <Style.Triggers>
                        <DataTrigger
                            Binding="{Binding ItemFuncCommand}"
                            Value="{Null}">
                            <Setter
                                Property="Command"
                                Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType=Page}}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>

                <Storyboard x:Key="SelectItemStory">
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(ZPanel.ClippingBias)">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="1" />
                    </Int32AnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="DropShadow">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="0.6" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                   Storyboard.TargetName="ShadowScale">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="1.0" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                                                   Storyboard.TargetName="ShadowScale">
                        <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                Value="1.0" />
                    </DoubleAnimationUsingKeyFrames>
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)"
                                                  Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=ContentPresenter}}">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="20" />
                    </Int32AnimationUsingKeyFrames>
                </Storyboard>
                <UIStoryboard x:Key="DeselectItemStory"
                              Duration="0:0:0.36">
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(ZPanel.ClippingBias)">
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                               Value="1" />
                        <DiscreteInt32KeyFrame KeyTime="0:0:0.3"
                                               Value="{x:Static Int32.MaxValue}" />
                    </Int32AnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                   Storyboard.TargetName="DropShadow">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleX)"
                                                   Storyboard.TargetName="ShadowScale">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0.75"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(ScaleTransform.ScaleY)"
                                                   Storyboard.TargetName="ShadowScale">
                        <EasingDoubleKeyFrame KeyTime="0:0:0.3"
                                              Value="0.75"
                                              EasingFunction="{CircleEasing}" />
                    </DoubleAnimationUsingKeyFrames>
                    <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)"
                                                  Storyboard.Target="{Binding RelativeSource={RelativeSource AncestorType=ContentPresenter}}">
                        <EasingInt32KeyFrame KeyTime="0:0:0.3"
                                             Value="0"
                                             EasingFunction="{CircleEasing}" />
                    </Int32AnimationUsingKeyFrames>
                </UIStoryboard>
                <Storyboard x:Key="PART_TransitionOut" />
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid x:Name="OuterContainer">
            <FZMaterial x:Name="DropShadow"
                        Style="{DynamicDataBinding DropShadowStyle, FallbackValue={StaticResource H_Style_FZMaterial_ShadowBase_ForSubgraph}}">
                <FZMaterial.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform
                                        ScaleX="0"
                                        ScaleY="0"
                                        x:Name="ShadowScale" />
                    </TransformGroup>
                </FZMaterial.RenderTransform>
            </FZMaterial>

            <Grid x:Name="ScaledContainer"
                  RenderTransformOrigin="0.5,0.5"
                  ZPanel.ZOffset="0"
                  Style="{DynamicDataBinding ScaledContainerStyle, FallbackValue={StaticResource H_Style_FrameworkElement_CarouselSelectionScale}}">
                <RoutedEventCommand
                    x:Name="MouseLeftButtonUpCommand"
                    RoutedEvent="UIElement.MouseLeftButtonUp"
                    Style="{StaticResource A_Style_RoutedEventCommand_MouseLeftButtonUp}" />
                <StrokeHighlightControl x:Name="FocusHighlight"
                         Style="{StaticResource H_Style_StrokeHighlight_Animated_TextMenu}"
                         IsEnabled="{Binding (Selector.IsSelected), FallbackValue=False, RelativeSource={RelativeSource TemplatedParent}}" />
                <ContentControl Style="{StaticResource H_Style_ContentControl_ContainerBackground}"
                                RoutedEventCommand.Action="{Binding ElementName=MouseLeftButtonUpCommand}">
                    <ContentPresenter x:Name="Presenter" />
                </ContentControl>
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger Property="Selector.IsSelected"
                     Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard x:Name="ShowSelected_BeginStoryboard2"
                                    HandoffBehavior="SnapshotAndReplace"
                                    Storyboard="{StaticResource SelectItemStory}" />
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard x:Name="HideSelected_BeginStoryboard2"
                                    HandoffBehavior="SnapshotAndReplace"
                                    Storyboard="{StaticResource DeselectItemStory}" />
                </Trigger.ExitActions>
            </Trigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
    
    <ControlTemplate
        x:Key="A_ControlTemplate_TextMenu_HighlightStroke"
        TargetType="ListBoxItem">
        <ControlTemplate.Resources>
            <ResourceDictionary>
                <Style
                    x:Key="A_Style_RoutedEventCommand_MouseLeftButtonUp"
                    TargetType="local:RoutedEventCommand">
                    <Setter
                        Property="Command"
                        Value="{Binding ItemFuncCommand}" />
                    <Style.Triggers>
                        <DataTrigger
                            Binding="{Binding ItemFuncCommand}"
                            Value="{Null}">
                            <Setter
                                Property="Command"
                                Value="{Binding SelectCommand, RelativeSource={RelativeSource AncestorType={Type Page}}}" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
                <Style
                    x:Key="A_Style_FrameworkElement_TextMenuItemContainer_Dynamic"
                    TargetType="{Type FrameworkElement}">
                    <Style.Triggers>
                        <DataTrigger
                            Binding="{Binding IsEnabled, RelativeSource={RelativeSource AncestorType=ListBoxItem}}"
                            Value="False">
                            <Setter
                                Property="Opacity"
                                Value="0.4" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </ResourceDictionary>
        </ControlTemplate.Resources>
        <Grid>
            <Grid
                x:Name="Background"
                RenderTransformOrigin="0.5,0.5"
                Style="{DynamicResource A_Style_FrameworkElement_TextMenuItemContainer_Dynamic}">
                <Grid.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform />
                        <SkewTransform />
                        <RotateTransform />
                        <TranslateTransform />
                    </TransformGroup>
                </Grid.RenderTransform>
                <FZMaterial
                    x:Name="DropShadow"
                    Style="{DynamicResource A_Style_FZMaterial_TextMenuItemShadow}"
                    IsHitTestVisible="False"
                    Visibility="Hidden" />
                <RoutedEventCommand
                    x:Name="MouseLeftButtonUpCommand"
                    RoutedEvent="UIElement.MouseLeftButtonUp"
                    Style="{StaticResource A_Style_RoutedEventCommand_MouseLeftButtonUp}" />
                <StrokeHighlightControl
                    x:Name="HighlightStroke"
                    Style="{StaticResource H_Style_StrokeHighlight_Animated_TextMenu}"
                    IsEnabled="False"
                    RoutedEventCommand.Action="{Binding ElementName=MouseLeftButtonUpCommand}"/>
                <FZMaterial
                    x:Name="BackgroundMaterial"
                    RoutedEventCommand.Action="{Binding ElementName=MouseLeftButtonUpCommand}"
                    Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}" />
                <ContentPresenter
                    x:Name="Presenter" />
            </Grid>
        </Grid>
        <ControlTemplate.Triggers>
            <Trigger
                Property="Tag"
                Value="GroupHeader">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Color"
                    Value="{StaticResource A_Color_TextMenu_Panel_Header}" />
            </Trigger>
            <Trigger
                Property="Tag"
                Value="Inactive">
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Preset"
                    Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}" />
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Color"
                    Value="{StaticResource A_Color_GlassPanel_Interactive}" />
            </Trigger>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Setter
                    TargetName="HighlightStroke"
                    Property="IsEnabled"
                    Value="True" />
            </Trigger>
            <Trigger
                Property="IsKeyboardFocusWithin"
                Value="True">
                <Trigger.EnterActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard1"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Focus}" />
                </Trigger.EnterActions>
                <Trigger.ExitActions>
                    <BeginStoryboard
                        x:Name="ShowSelected_BeginStoryboard2"
                        Storyboard="{StaticResource A_StoryBoard_TextMenu_Blur}" />
                </Trigger.ExitActions>
                <Setter
                    Property="Visibility"
                    TargetName="DropShadow"
                    Value="Visible" />
                <Setter
                    Property="local:ZPanel.DisableClipping"
                    Value="True" />
                <Setter
                    Property="local:ZPanel.ZIndex"
                    Value="20" />
            </Trigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding IsKeyboardFocusWithin, RelativeSource={RelativeSource Self}}"
                        Value="True" />
                    <Condition
                        Binding="{Binding (ItemContainerGenerator.ItemForItemContainer), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_IsNotNull}}"
                        Value="True" />
                </MultiDataTrigger.Conditions>
                <Setter
                    Property="IsSelected"
                    Value="True" />
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition
                        Binding="{Binding Content.Focusable, RelativeSource={RelativeSource Self}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Focusable, RelativeSource={RelativeSource Self}}"
                        Value="False" />
                    <Condition
                        Binding="{Binding Tag, RelativeSource={RelativeSource Self}}"
                        Value="{Null}" />
                </MultiDataTrigger.Conditions>
                <Setter
                    TargetName="BackgroundMaterial"
                    Property="Visibility"
                    Value="Collapsed" />
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>
</ResourceDictionary>