<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">
    
    <!-- Tile Sizes -->
    <System:Double x:Key="A_Double_ZOffset_Selected">-10</System:Double>

    <System:Double x:Key="A_Double_Size_Tile">135</System:Double>
    <System:Double x:Key="A_Double_Size_TileX2">275</System:Double>
    <System:Double x:Key="A_Double_Size_TileX4">555</System:Double>
    <System:Double x:Key="A_Double_Size_TileX6">835</System:Double>
    
    <System:Double x:Key="A_Double_Size_TileUnitSizeWithGap">140</System:Double>
    <System:Double x:Key="A_Double_Size_TileNegativeGap">-5</System:Double>
    <System:Double x:Key="A_Double_Size_TileGap">5</System:Double>

    <System:Double x:Key="A_Double_Size_SunriseTileUnitSizeWithGap">24</System:Double>
    <System:Double x:Key="A_Double_Size_SunriseTileGap">6</System:Double>
    <System:Double x:Key="A_Double_Size_SunriseTileNegativeGap">-6</System:Double>

    <System:Double x:Key="A_Double_Size_Tile_TitlePanel">90</System:Double>
    <System:Double x:Key="A_Double_Size_Tile_TitlePanel_Shallow">76</System:Double>

    <!-- Adding an extra .5 to the stroke thickness as we were getting 'cracks' between the highlight and tile contents -->
    <Thickness x:Key="A_Thickness_TileEdgeBorderOnly">3,3,3,3</Thickness>
    <Thickness x:Key="A_Thickness_TileEdgeBorderOnly_WithOffset">3.5,3.5,3.5,3.5</Thickness>
    <Thickness x:Key="A_Thickness_TileBorderedBackground">3,3,3,90</Thickness>
    <Thickness x:Key="A_Thickness_TileBorderedBackground_WithOffset">3.5,3.5,3.5,90.5</Thickness>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_TileBackground_BorderedImage"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
        Thickness="{StaticResource A_Thickness_TileBorderedBackground_WithOffset}"/>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_TileBackground_EdgeBorderOnly"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
        Thickness="{StaticResource A_Thickness_TileEdgeBorderOnly_WithOffset}"/>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_CharacterSelect_Background"
                            BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
                            GradientColorA="#FFB6B6B6"
                            GradientColorB="#FFFFFFFF"
                            GradientAngle="0"/>

    <GridLength x:Key="A_GridLength_TileMenu_Height">768</GridLength>

    <!-- Converters -->
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_TilePositionTransform" Scale="{StaticResource A_Double_Size_TileUnitSizeWithGap}"/>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_TileSizeTransform"
                                    Scale="{StaticResource A_Double_Size_TileUnitSizeWithGap}"
                                    Add="{StaticResource A_Double_Size_TileNegativeGap}" />

    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_SunriseTilePositionTransform"
                                    Scale="{StaticResource A_Double_Size_SunriseTileUnitSizeWithGap}"/>
    <local:LinearTransformConverter x:Key="A_LinearTransformConverter_SunriseTileSizeTransform"
                                    Scale="{StaticResource A_Double_Size_SunriseTileUnitSizeWithGap}"
                                    Add="{StaticResource A_Double_Size_SunriseTileNegativeGap}" />

    <!-- CircleGeometry -->
    <local:FZGeometry x:Key="A_FZGeometry_Circle" Data="M 0,0 A 180,180 180 1 1 1,1 Z"/>

    <!--Converters-->
    <local:FZBooleanToVisibilityConverter x:Key="A_Converter_BoolVisibility"/>

    <!-- Padding -->
    <Thickness x:Key="A_Thickness_TilePadding_IconTile">15</Thickness>
    <Thickness x:Key="A_Thickness_TilePadding">20</Thickness>
    <Style x:Key="A_Style_Grid_MotionBlur" TargetType="{x:Type Grid}">
        <Setter Property="Grid.Effect" Value="{StaticResource A_MotionBlurEffect}" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding (local:BindingProxy.C), RelativeSource={RelativeSource TemplatedParent}}" Value="DisableMotionBlur">
                <Setter Property="Grid.Effect" Value="{x:Null}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    <Style x:Key="A_Style_FZMaterial_MotionBlurExpander" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Margin" Value="-10" />
        <Setter Property="Opacity" Value="0" />
        <Setter Property="IsHitTestVisible" Value="False" />
    </Style>    

        <!--Transition Style -->
    <Style x:Key="A_Style_FrameworkElement_TransitionStyle" TargetType="{x:Type FrameworkElement}">
        <Setter Property="local:ZPanel.TransformOrigin" Value="0.5,0.5"/>
        <Setter Property="local:ZPanel.Transform">
            <Setter.Value>
                <local:XRotation Angle="0"/>
            </Setter.Value>
        </Setter>
        <Style.Resources>
            <Duration x:Key="A_Duration_MenuPageTransition_Off">0:0:0.125</Duration>
            <Duration x:Key="A_Duration_MenuPageTransition_On">0:0:0.225</Duration>
            <local:UIStoryboard x:Key="PART_ANIMATION_Off" DurationOverride="{StaticResource A_Duration_MenuPageTransition_Off}">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(local:XRotation.Angle)" Storyboard.TargetName="{x:Null}">
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="90" EasingFunction="{local:LinearEasing}"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                               Storyboard.TargetName="{x:Null}">
                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.64" Value="1"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:1.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)"
                                                Storyboard.TargetName="{x:Null}">
                    <!-- To disable mouse functionality when animating on or off -->
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0.02"
                                             Value="False" />
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(local:TileMenuNavigationManager.IsOnActiveMenu)"
                                                Storyboard.TargetName="{x:Null}">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:0.02"
                                             Value="False" />
                </BooleanAnimationUsingKeyFrames>
            </local:UIStoryboard>
            <local:UIStoryboard x:Key="PART_ANIMATION_On" DurationOverride="{StaticResource A_Duration_MenuPageTransition_On}">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.Transform).(local:XRotation.Angle)" Storyboard.TargetName="{x:Null}">
                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0" Value="-90"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="0" EasingFunction="{local:CubicEasing EasingMode=EaseOut}"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                Storyboard.TargetName="{x:Null}">
                    <LinearDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                    <LinearDoubleKeyFrame KeyTime="0:0:0.2" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.IsHitTestVisible)"
                                                Storyboard.TargetName="{x:Null}">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:1.0"
                                             Value="True" />
                </BooleanAnimationUsingKeyFrames>
                <BooleanAnimationUsingKeyFrames Storyboard.TargetProperty="(local:TileMenuNavigationManager.IsOnActiveMenu)"
                                                Storyboard.TargetName="{x:Null}">
                    <DiscreteBooleanKeyFrame KeyTime="0:0:1.0"
                                             Value="True" />
                </BooleanAnimationUsingKeyFrames>
            </local:UIStoryboard>
        </Style.Resources>
    </Style>

    <!--FZTextblock Styles-->
  
    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToTileTextColor"
        Default="{StaticResource A_Color_Tile_Text}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_Text_ExpansionTwo}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToTileTextColor_Alternate"
        Default="{StaticResource A_Color_Tile_Text_Alternate}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_Text_Alternate_ExpansionTwo}"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZTextBlock_TileText_Base" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTextColor}, FallbackValue={StaticResource A_Color_Tile_Text}}"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="TextAlignment" Value="Left"/>
        <Setter Property="LineAdjust" Value="-0.3"/>
        <Setter Property="FontSize" Value="24" />
        <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding DataContext.Description, RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}" />
        <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_Run_TileText_"/>
        <Setter Property="Margin" Value="0" />
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Text, Converter={StaticResource A_StringVisConverter}, RelativeSource={RelativeSource Self}, FallbackValue={x:Static Visibility.Collapsed}}" Value="{x:Static Visibility.Collapsed}"/>
                    <Condition Binding="{Binding (local:TextBlockInlineMarkup.Markup), Converter={StaticResource A_StringVisConverter}, RelativeSource={RelativeSource Self}, FallbackValue={x:Static Visibility.Collapsed}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="{x:Static Visibility.Collapsed}"/>
            </MultiDataTrigger> 
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileText" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_Base}">
        <Style.Resources>
            <Color x:Key="A_Color_Tile_Text_Alternate">#FFFFFFFF</Color>
        </Style.Resources>
        <Style.Triggers>
            <DataTrigger Binding="{Binding UseAlternateColors}"
                         Value="True">
                <Setter Property="Color"
                        Value="{DynamicResource A_Color_Tile_Text_Alternate}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Tile_Text_Locked_Alternate}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileText_IconTile" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_Base}">
        <Style.Resources>
            <Color x:Key="A_Color_Tile_Text_Alternate">#FFFFFFFF</Color>
        </Style.Resources>
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="VerticalAlignment" Value="Center" />
        <Setter Property="TextWrapping" Value="WrapWithOverflow" />
        <Setter Property="MaxHeight" Value="60" />
        <Setter Property="Margin" Value="75,0,0,0" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding UseAlternateColors}"
                         Value="True">
                <Setter Property="Color"
                        Value="{DynamicResource A_Color_Tile_Text_Alternate}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Tile_Text_Icon_Locked}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileText_ImageTile" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_TileText}">
        <Setter Property="Margin" Value="0,8,0,0"/>
        <Style.Resources>
            <Color x:Key="A_Color_Tile_Text_Alternate">#FF00B592</Color>
        </Style.Resources>
        <Style.Triggers>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{local:Loc TiledMenus.IDS_TileText_NotAvailable}"/>
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                               Value="{x:Static local:LockState.Locked}" />
                    <Condition Binding="{Binding UseAlternateColors}"
                               Value="False" />
                </MultiDataTrigger.Conditions>
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Tile_Text_Locked}" />
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileText_ImageTile_Alternate" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_ImageTile}">
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTextColor_Alternate}, FallbackValue={StaticResource A_Color_Tile_Text_Alternate}}"/>
    </Style>

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

    <Style x:Key="A_Style_FZTextBlock_TilePrompt" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_Base}">
        <Setter Property="Color" Value="{StaticResource A_Color_TileSelected_Text}"/>
        <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding DataContext.HighlightPrompt, RelativeSource={RelativeSource TemplatedParent}}" />
    <Setter Property="VerticalAlignment" Value="Center"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
    </Style>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToTileTitleColor"
        Default="{StaticResource A_Color_Tile_Title}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_Title_ExpansionTwo}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToTileTitleColor_Alternate"
        Default="{StaticResource A_Color_Tile_Title_Alternate}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_Title_Alternate_ExpansionTwo}"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZTextBlock_TileTitle" TargetType="{x:Type local:FZTextBlock}" BasedOn="{StaticResource A_Style_FZTextBlock_Title}">
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTitleColor}, FallbackValue={StaticResource A_Color_Tile_Title}}"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="VerticalAlignment" Value="Top" />
        <Setter Property="HorizontalAlignment" Value="Left" />
        <Setter Property="TextAlignment" Value="Left"/>
        <Setter Property="FontSize"
                Value="34" />
        <Setter Property="local:TextBlockInlineMarkup.Markup" Value="{Binding DataContext.Heading, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_StringToUpper}}" />
        <Setter Property="local:TextBlockInlineMarkup.ResourceBaseName" Value="A_Style_FZRun_TileTitle_" />
        <Setter Property="Margin"
                Value="0" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding DataContext.UseAlternateColors, RelativeSource={RelativeSource AncestorType=Button}}" Value="True">
                <Setter Property="Color"
                        Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTitleColor_Alternate}, FallbackValue={StaticResource A_Color_Tile_Title_Alternate}}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Tile_Title_Locked}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileTitle_Alternate"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_TileTitle}">
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTitleColor_Alternate}, FallbackValue={StaticResource A_Color_Tile_Title_Alternate}}"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileTitle_Large"
        BasedOn="{StaticResource A_Style_FZTextBlock_Title}"
        TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToTileTitleColor_Alternate}, FallbackValue={StaticResource A_Color_Tile_Title_Alternate}}"/>
        <Setter Property="FontFamily" Value="Horizon_A"/>
        <Setter Property="CapHeight" Value="25"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="Stretch" Value="Uniform" />
        <Setter Property="StretchDirection" Value="DownOnly" />
        <Setter Property="VerticalAlignment" Value="Center" />
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileTitle_Large_Sub"
        BasedOn="{StaticResource A_Style_FZTextBlock_TileTitle_Large}"
        TargetType="{x:Type local:FZTextBlock}">
        <Setter Property="FontFamily" Value="Horizon_B"/>
        <Setter Property="Margin" Value="0,0,6,0"/>
        <Setter Property="Visibility" Value="{Binding Text, RelativeSource={RelativeSource Self}, Converter={StaticResource A_StringVisConverter}}"/>
    </Style>

    <CircleEase x:Key="A_EasingFunction_TileSelection" EasingMode="EaseOut" />

    <Storyboard x:Key="A_Storyboard_Tile_Selected">
        <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)">
            <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                    Value="3">
            </DiscreteInt32KeyFrame>
        </Int32AnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.ZOffset)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="0">
            </DiscreteDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="1.04">
            </DiscreteDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                    Value="1.04">
            </DiscreteDoubleKeyFrame>
        </DoubleAnimationUsingKeyFrames>
    </Storyboard>

    <Storyboard x:Key="A_Storyboard_Tile_Unselected">
        <Int32AnimationUsingKeyFrames Storyboard.TargetProperty="(Panel.ZIndex)" FillBehavior="Stop">
            <DiscreteInt32KeyFrame KeyTime="0:0:0.0"
                                   Value="1">
            </DiscreteInt32KeyFrame>
            <DiscreteInt32KeyFrame KeyTime="0:0:0.36"
                                   Value="0">
            </DiscreteInt32KeyFrame>
        </Int32AnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(local:ZPanel.ZOffset)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                  Value="0"
                                  EasingFunction="{StaticResource A_EasingFunction_TileSelection}"/>
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                  Value="1.00"
                                  EasingFunction="{StaticResource A_EasingFunction_TileSelection}" />
        </DoubleAnimationUsingKeyFrames>
        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
            <EasingDoubleKeyFrame KeyTime="0:0:0.36"
                                  Value="1.00"
                                  EasingFunction="{StaticResource A_EasingFunction_TileSelection}" />
        </DoubleAnimationUsingKeyFrames>
        
    </Storyboard>

    <local:LinearTransformConverter x:Key="A_TransitionIndexToZIndexConverter"
        Add="-100"
        Scale="-1"/>

    <local:MappingConverter x:Key="A_Converter_TileStateToVisibility"
        Default="{x:Static Visibility.Visible}">
        <local:MappingConverterEntry Key="{x:Static local:TileState.Enabled}" Value="{x:Static Visibility.Visible}"/>
        <local:MappingConverterEntry Key="{x:Static local:TileState.EnabledNonInteractive}" Value="{x:Static Visibility.Visible}"/>
        <local:MappingConverterEntry Key="{x:Static local:TileState.Disabled}" Value="{x:Static Visibility.Collapsed}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_TileStateToBoolean"
        Default="True">
        <local:MappingConverterEntry Key="{x:Static local:TileState.Enabled}" Value="True"/>
        <local:MappingConverterEntry Key="{x:Static local:TileState.EnabledNonInteractive}" Value="False"/>
        <local:MappingConverterEntry Key="{x:Static local:TileState.Disabled}" Value="False"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_BooleanToTileState"
        Default="{x:Static local:TileState.Disabled}">
        <local:MappingConverterEntry Key="True" Value="{x:Static local:TileState.Enabled}"/>
        <local:MappingConverterEntry Key="False" Value="{x:Static local:TileState.Disabled}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_BooleanToTileState_Inverse"
        Default="{x:Static local:TileState.Disabled}">
        <local:MappingConverterEntry Key="True" Value="{x:Static local:TileState.Disabled}"/>
        <local:MappingConverterEntry Key="False" Value="{x:Static local:TileState.Enabled}"/>
    </local:MappingConverter>


    <!-- Tile Styles -->
    <Style x:Key="A_Style_Button_RootTile" TargetType="{x:Type local:FZButton}" BasedOn="{StaticResource A_Style_FrameworkElement_TransitionStyle}">
        <Setter Property="Width"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridWidth) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SunriseTileSizeTransform}}" />
        <Setter Property="Height"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridHeight) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SunriseTileSizeTransform}}" />
        <Setter Property="Canvas.Left"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridX) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SunriseTilePositionTransform}}" />
        <Setter Property="Canvas.Top"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridY) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_SunriseTilePositionTransform}}" />
        <Setter Property="local:TileMenuNavigationManager.AutoTransitionIndex"
                Value="{x:Static local:TiledMenuAutoTransitionIndex.SetAutoIfInvalid}" />
        <Setter Property="local:TileMenuNavigationManager.TileColorScheme"
                Value="{x:Static local:TileColorScheme.Default}"/>
        <Setter Property="Panel.ZIndex"
                Value="{Binding (local:UIPageTransitionManager.TransitionIndex), RelativeSource={RelativeSource Self}, Converter={StaticResource A_TransitionIndexToZIndexConverter}}"/>
        <Setter Property="local:ZPanel.ZOffset" Value="0"/>
        <Setter Property="local:BindingProxy.C" Value="DisableMotionBlur"/>
        <Setter Property="RenderTransformOrigin"
                Value="0.5,0.5" />
        <Setter Property="UseSelfAsDefaultCommandParameter"
                Value="True"/>
        <Setter Property="local:MultiStringFormatter.Param0"
                Value="{Binding Heading}"/>
        <Setter Property="local:MultiStringFormatter.Param1"
                Value="{Binding Description}"/>
        <Setter Property="local:ManualPassthroughProperty.Input"
                Value="{Binding (local:MultiStringFormatter.Output), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TrimInlineMarkupAndNewlines}}"/>
        <Setter Property="local:ManualPassthroughProperty.Allowed"
                Value="{Binding IsKeyboardFocused, RelativeSource={RelativeSource Self}}"/>
        <Setter Property="local:ScreenReader.Line"
                Value="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}}" />
        <Setter Property="local:ScreenReader.Event"
                Value="OnChange" />
        <Setter Property="local:ScreenReader.ControlType"
                Value="Button" />
        <Setter Property="local:ScreenReader.LineType"
                Value="SelectedItem" />
        <Setter Property="local:AccumulateSelfOnParent.ParentType"
                Value="{x:Type Canvas}" />
        <Setter Property="local:FindSelfIndexInCollection.Collection"
                Value="{Binding (local:AccumulateSelfOnParent.Output), RelativeSource={RelativeSource AncestorType={x:Type Canvas}}}" />
        <Setter Property="local:ScreenReader.SelectedNumber"
                Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}" />
        <Setter Property="local:ScreenReader.SelectedCount"
                Value="{Binding (local:AccumulateSelfOnParent.Output).Count, RelativeSource={RelativeSource AncestorType={x:Type Canvas}}, FallbackValue=0}" />
        <Setter Property="Visibility"
                Value="{Binding (local:TileMenuNavigationManager.TileState), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TileStateToVisibility}, FallbackValue={x:Static Visibility.Visible}}"/>
        <Setter Property="IsEnabled"
                Value="{Binding (local:TileMenuNavigationManager.TileState), RelativeSource={RelativeSource Self}, Converter={StaticResource A_Converter_TileStateToBoolean}, FallbackValue=True}"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <ScaleTransform/>
                    <SkewTransform/>
                    <RotateTransform/>
                    <TranslateTransform/>
                </TransformGroup>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="local:TileMenuNavigationManager.TileState" Value="{x:Static local:TileState.Enabled}">
                <Setter Property="local:AccumulateSelfOnParent.SortOrder"
                        Value="{Binding (local:TileMenuNavigationManager.SortIndex), RelativeSource={RelativeSource Self}}"/>
            </Trigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsKeyboardFocused}" Value="True">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Tile_Selected}"/>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_Tile_Unselected}"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="IsMouseOver"
                               Value="True"/>
                    <Condition Property="local:TileMenuNavigationManager.TileState"
                               Value="{x:Static local:TileState.Enabled}"/>
                </MultiTrigger.Conditions>
                <MultiTrigger.EnterActions>
                    <local:CommandAction CommandPropertyName="HighlightTile" AncestorType="Page" />
                </MultiTrigger.EnterActions>
            </MultiTrigger>
            <DataTrigger Binding="{Binding Description, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Visible}">
                <Setter Property="local:MultiStringFormatter.Format" Value="{local:Loc Main.IDS_ScreenReader_Format_Tile_DescriptionOnly}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding Heading, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Visible}">
                <Setter Property="local:MultiStringFormatter.Format" Value="{local:Loc Main.IDS_ScreenReader_Format_Tile_HeadingOnly}"/>
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Heading, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Visible}"/>
                    <Condition Binding="{Binding Description, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Visible}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="local:MultiStringFormatter.Format" Value="{local:Loc Main.IDS_ScreenReader_Format_Tile_HeadingAndDescription}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_Button_OpusTile" TargetType="{x:Type local:FZButton}" BasedOn="{StaticResource A_Style_Button_RootTile}" >
        <Setter Property="Width"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridWidth) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_TileSizeTransform}}" />
        <Setter Property="Height"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridHeight) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_TileSizeTransform}}" />
        <Setter Property="Canvas.Left"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridX) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_TilePositionTransform}}" />
        <Setter Property="Canvas.Top"
                Value="{Binding Path=(local:TileMenuNavigationManager.GridY) ,RelativeSource={RelativeSource Self}, Converter={StaticResource A_LinearTransformConverter_TilePositionTransform}}" />
    </Style>

    <Style x:Key="A_Style_Button_Tile_2x1"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="2"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="1"/>
    </Style>
    <Style x:Key="A_Style_Button_Tile_2x2"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="2"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="2"/>
    </Style>
    <Style x:Key="A_Style_Button_Tile_4x2"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="4"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="2"/>
    </Style>
    <Style x:Key="A_Style_Button_Tile_2x4"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="2"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="4"/>
    </Style>
    <Style x:Key="A_Style_Button_Tile_4x4"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="4"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="4"/>
    </Style>
    <Style x:Key="A_Style_Button_Tile_6x2"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_OpusTile}">
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="6"/>
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="2"/>
    </Style>


    <Style x:Key="A_Style_BlankVisualStyle" />

    <Style x:Key="A_Style_FZMaterial_TileBackground_Base"
           TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}">
        <Setter Property="Opacity"
                Value="1.0" />
        <Setter Property="HorizontalAlignment"
                Value="Stretch" />
        <Setter Property="VerticalAlignment"
                Value="Stretch" />
        <Setter Property="StretchDirection"
                Value="Both" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_TileBackground"
           TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_TileBackground_Base}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding UseAlternateColors}"
                         Value="True">
                <Setter Property="Color"
                        Value="{StaticResource A_Color_Tile_Background_Alternate}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.TileState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                        Value="{x:Static local:TileState.EnabledNonInteractive}">
                <Setter Property="Preset"
                        Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_GlassPanel_TileMenu_NonInteractive}" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Preset"
                        Value="{StaticResource A_FZMaterialPresetGlassRoundtangle_GlassPanel_OuterAll}" />
                <Setter Property="Color"
                        Value="{StaticResource A_Color_GlassPanel_Interactive}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_TileBackground_NoAlternate"
           TargetType="local:FZMaterial" BasedOn="{StaticResource A_Style_FZMaterial_TileBackground_Base}">
    </Style>

    <Style x:Key="A_Style_FZMaterial_TileBackground_NoCornersTinted"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_TileBackground}">
        <Setter Property="Color" Value="#FFEBEBEB"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"/>
    </Style>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_Desaturated"
        BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
        Saturation="0"/>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_OuterAllDesaturated"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"
        Saturation="0"/>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_OuterTopOnlyDesaturated"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterTopOnly}"
        Saturation="0"/>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_FlatPanel_InnerAllDesaturated"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"
        Saturation="0"/>

    <Style x:Key="A_Style_FZMaterial_LockableImageTileBackground_Base"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_TileBackground_Base}">
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterTopOnly}"/>
        <Setter Property="local:ManualPassthroughProperty.Input" Value="{Binding DataContext.Icon, RelativeSource={RelativeSource AncestorType=local:FZButton}}" />
        <Setter Property="local:ManualPassthroughProperty.Allowed" Value="{Binding IsInitialized, RelativeSource={RelativeSource AncestorType=Page}, FallbackValue={StaticResource A_Boolean_True}}"/>
        <Setter Property="ImageSource" Value="{Binding (local:ManualPassthroughProperty.Output), RelativeSource={RelativeSource Self}}"/>
        <Setter Property="Visibility" Value="{Binding ImageSource, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LockableImageTileBackground"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_Base}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding UseAlternateColors}" Value="True">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAll}"/>
            </DataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}" Value="{x:Static local:LockState.Locked}"/>
                    <Condition Binding="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Value="{x:Static Visibility.Visible}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="local:ManualPassthroughProperty.Input" Value="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource TemplatedParent}}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}" Value="{x:Static local:LockState.Locked}"/>
                    <Condition Binding="{Binding UseAlternateColors, RelativeSource={RelativeSource AncestorType=Button}}" Value="False"/>
                    <Condition Binding="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterTopOnlyDesaturated}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}" Value="{x:Static local:LockState.Locked}"/>
                    <Condition Binding="{Binding UseAlternateColors, RelativeSource={RelativeSource AncestorType=Button}}" Value="True"/>
                    <Condition Binding="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_OuterAllDesaturated}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LockableImageTileBackground_NoCorners"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_Base}">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}" Value="{x:Static local:LockState.Locked}"/>
                    <Condition Binding="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Value="{x:Static Visibility.Visible}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="local:ManualPassthroughProperty.Input" Value="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}}"/>
            </MultiDataTrigger>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}" Value="{x:Static local:LockState.Locked}"/>
                    <Condition Binding="{Binding DataContext.LockedIcon, RelativeSource={RelativeSource AncestorType=Button}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_Desaturated}"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_Tile_LockIcon"
           TargetType="local:FZMaterial">
        <Setter Property="Opacity"
                Value="0.0" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
        <Setter Property="Height"
                Value="90" />
        <Setter Property="Width"
                Value="90" />
        <Setter Property="ImageSourceNoPreload"
                Value="/ForzaUI;component/Textures/Anthem/Icons/PauseMenu/Lock.png" />
        <Setter Property="Preset"
                Value="{StaticResource A_FZMaterialPreset_Glossy}" />
        <Setter Property="Margin"
                Value="-13,0,0,0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Opacity"
                        Value="0.5" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FrameworkElement_HiddenWhenLocked"
           TargetType="FrameworkElement">
        <Style.Triggers>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Opacity"
                        Value="0.0" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_ContentControl_NotificationBadge_Tile"
           TargetType="{x:Type ContentControl}">
        <Style.Resources>
            <ImageSource x:Key="A_ImageSource_NotificationBadge_Tile_Background_Dynamic">/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/NotificationBadges/Badge_IconTile.png</ImageSource>
            <ImageSource x:Key="A_ImageSource_NotificationBadge_Tile_Background_Alternate_Dynamic">/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/NotificationBadges/Badge_IconTile_Alternate.png</ImageSource>
            <System:Double x:Key="A_Double_NotificationBadge_Tile_BackgroundHeight_Dynamic">43</System:Double>
            <Color x:Key="A_Color_NotificationBadge_Text_Alternate_Dynamic">#FF00B592</Color>
            <local:UIStoryboard x:Key="A_Storyboard_NotificationBadge_Hide_Instant">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                    Storyboard.TargetName="{x:Null}">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </local:UIStoryboard>
            <local:UIStoryboard x:Key="A_Storyboard_NotificationBadge_Show" DurationOverride="0:0:0.4">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                    Storyboard.TargetName="{x:Null}">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleX)"
                    Storyboard.TargetName="{x:Null}"
                    BeginTime="0:0:0.3">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.65" Value="1.125" EasingFunction="{local:QuadraticEasing EasingMode=EaseOut}"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="1" EasingFunction="{local:QuadraticEasing EasingMode=EaseIn}"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(ScaleTransform.ScaleY)"
                    Storyboard.TargetName="{x:Null}"
                    BeginTime="0:0:0.3">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:0.65" Value="1.125" EasingFunction="{local:QuadraticEasing EasingMode=EaseOut}"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0" Value="1" EasingFunction="{local:QuadraticEasing EasingMode=EaseIn}"/>
                </DoubleAnimationUsingKeyFrames>
            </local:UIStoryboard>
        </Style.Resources>
        <Setter Property="HorizontalAlignment"
                Value="Right" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
        <Setter Property="Panel.ZIndex"
                Value="1" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="RenderTransform">
            <Setter.Value>
                <ScaleTransform/>
            </Setter.Value>
        </Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <local:FZMaterial x:Name="NotificationBadgeBackground"
                                      HorizontalAlignment="Left"
                                      VerticalAlignment="Top"
                                      Width="43"
                                      Height="{DynamicResource A_Double_NotificationBadge_Tile_BackgroundHeight_Dynamic}"
                                      ImageSource="{DynamicResource A_ImageSource_NotificationBadge_Tile_Background_Dynamic}"
                                      Margin="0,0,-6,-9"
                                      Visibility="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_StringVisConverter}}">
                        <Decorator Margin="4,1,0,0"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Top"
                            Width="26"
                            Height="26">
                            <local:FZTextBlock x:Name="NotificationBadgeText"
                                           Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                           Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                           Color="{StaticResource A_Color_NotificationBadge_Text}"
                                           FontSize="19"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center"
                                           Margin="2,0" />
                        </Decorator>
                    </local:FZMaterial>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding UseAlternateColors}" Value="True">
                            <Setter Property="ImageSource" TargetName="NotificationBadgeBackground" Value="{DynamicResource A_ImageSource_NotificationBadge_Tile_Background_Alternate_Dynamic}"/>
                            <Setter Property="Color" TargetName="NotificationBadgeText" Value="{DynamicResource A_Color_NotificationBadge_Text_Alternate_Dynamic}"/>
                        </DataTrigger>
                        <DataTrigger Binding="{Binding Path=(local:UIPageTransitionManager.TransitionManager).(TransitionState), RelativeSource={RelativeSource AncestorType=Page}, FallbackValue={x:Static local:UIPageTransitionState.Idle}}"
                            Value="{x:Static local:UIPageTransitionState.TransitioningInForward}">
                            <DataTrigger.EnterActions>
                                <BeginStoryboard Storyboard="{StaticResource A_Storyboard_NotificationBadge_Hide_Instant}"/>
                            </DataTrigger.EnterActions>
                            <DataTrigger.ExitActions>
                                <BeginStoryboard Storyboard="{StaticResource A_Storyboard_NotificationBadge_Show}"/>
                            </DataTrigger.ExitActions>
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ContentControl_NotificationBadge_IconTile"
           TargetType="{x:Type ContentControl}"
           BasedOn="{StaticResource A_Style_ContentControl_NotificationBadge_Tile}">
        <Setter Property="RenderTransformOrigin" Value="0.46, 0.46"/>
    </Style>

    <Style x:Key="A_Style_ContentControl_NotificationBadge_ImageTile"
           TargetType="{x:Type ContentControl}"
           BasedOn="{StaticResource A_Style_ContentControl_NotificationBadge_Tile}">
        <Setter Property="RenderTransformOrigin" Value="0.395, 0.135"/>
        <Setter Property="Width" Value="43"/>
        <Setter Property="Height" Value="105"/>
        <Style.Resources>
            <ImageSource x:Key="A_ImageSource_NotificationBadge_Tile_Background_Dynamic">/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/NotificationBadges/Badge_ImageTile.png</ImageSource>
            <ImageSource x:Key="A_ImageSource_NotificationBadge_Tile_Background_Alternate_Dynamic">/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/NotificationBadges/Badge_ImageTile.png</ImageSource>
            <System:Double x:Key="A_Double_NotificationBadge_Tile_BackgroundHeight_Dynamic">60</System:Double>
            <Color x:Key="A_Color_NotificationBadge_Text_Alternate_Dynamic">#FFFFFFFF</Color>
        </Style.Resources>
    </Style>

    <Style x:Key="A_Style_Control_NewBanner_ImageTile"
           TargetType="{x:Type Control}">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Control">
                    <Grid x:Name="NewTag"
                          ClipToBounds="True"
                          Margin ="-0.5,0">
                        <local:FZMaterial Height="40"
                                      Width="220"
                                      Color="#FF00B592"
                                      HorizontalAlignment="Right"
                                      VerticalAlignment="Top"
                                      Margin="0,15,-75,0"
                                      RenderTransformOrigin="0.5,0.5">
                            <local:FZMaterial.RenderTransform>
                                <RotateTransform Angle="45" />
                            </local:FZMaterial.RenderTransform>
                            <local:FZTextBlock Text="{local:Loc InGame.IDS_New}"
                                           CapHeight="18"
                                           MaxWidth="80"
                                           Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                           Color="{StaticResource A_Color_Tile_Title_Alternate}"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center" />
                        </local:FZMaterial>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <local:MappingConverter x:Key="A_Converter_ForzathonSeasonalHeaderStrings"
        Default="{local:Loc PauseMenu.IDS_TileTitle_Forzathon_Spring}">
        <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="{local:Loc PauseMenu.IDS_TileTitle_Forzathon_Spring}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="{local:Loc PauseMenu.IDS_TileTitle_Forzathon_Summer}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="{local:Loc PauseMenu.IDS_TileTitle_Forzathon_Autumn}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="{local:Loc PauseMenu.IDS_TileTitle_Forzathon_Winter}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_ExpansionOne_ForzathonSeasonalHeaderStrings"
        Default="{local:Loc PauseMenu.IDS_TileTitle_Expansions_Forzathon_Spring}">
        <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="{local:Loc PauseMenu.IDS_TileTitle_Expansions_Forzathon_Spring}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="{local:Loc PauseMenu.IDS_TileTitle_Expansions_Forzathon_Summer}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="{local:Loc PauseMenu.IDS_TileTitle_Expansions_Forzathon_Autumn}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="{local:Loc PauseMenu.IDS_TileTitle_Expansions_Forzathon_Winter}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_ExpansionTwo_ForzathonSeasonalHeaderStrings"
        Default="{local:Loc PauseMenu.IDS_TileTitle_ExpansionTwo_Forzathon_Spring}">
        <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="{local:Loc PauseMenu.IDS_TileTitle_ExpansionTwo_Forzathon_Spring}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="{local:Loc PauseMenu.IDS_TileTitle_ExpansionTwo_Forzathon_Summer}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="{local:Loc PauseMenu.IDS_TileTitle_ExpansionTwo_Forzathon_Autumn}"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="{local:Loc PauseMenu.IDS_TileTitle_ExpansionTwo_Forzathon_Winter}"/>
    </local:MappingConverter>

    <CornerRadius x:Key="A_CornerRadius_FloatingIcon">24</CornerRadius>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetroundtangle_FlatPanel_FloatingIcon"
        BasedOn="{StaticResource A_FZMaterialPreset_FlatPanel_Base}"
        CornerRadius="{StaticResource A_CornerRadius_FloatingIcon}"/>
    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetroundtangle_FlatPanel_FloatingIcon_Highlight"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight}"
        CornerRadius="{StaticResource A_CornerRadius_FloatingIcon}"/>


    <local:MappingConverter x:Key="A_Converter_Season_To_FloatingIconTexture">
        <local:MappingConverterEntry Key="{x:Static local:Season.Spring}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Spring.png"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Summer}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Summer.png"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Autumn}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Autumn.png"/>
        <local:MappingConverterEntry Key="{x:Static local:Season.Winter}" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Winter.png"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToFloatingIconForegroundColor"
        Default="{StaticResource A_Color_Tile_FloatingIcon_Foreground}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_FloatingIcon_Foreground_ExpansionTwo}"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToFloatingIconBackgroundColor"
        Default="{StaticResource A_Color_Tile_FloatingIcon_Background}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_Tile_FloatingIcon_Background_ExpansionTwo}"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_FloatingIcon" TargetType="local:FZMaterial">
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetroundtangle_FlatPanel_FloatingIcon}"/>
        <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToFloatingIconBackgroundColor}, FallbackValue={StaticResource A_Color_Tile_FloatingIcon_Background}}"/>
        <Setter Property="Margin" Value="12,0,0,75"/>
        <Setter Property="Width" Value="48"/>
        <Setter Property="Height" Value="48"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
        <Setter Property="RenderTransform">
            <Setter.Value>
                <ScaleTransform ScaleX="1" ScaleY="1"/>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ContentControl_FloatingIcon_Tile"
           TargetType="{x:Type ContentControl}">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Bottom" />
        <Setter Property="Panel.ZIndex"
                Value="1" />
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="Height"
                Value="140" />
        <Setter Property="Width"
                Value="175" />
        <Setter Property="Visibility"
                Value="{Binding Content, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <Setter Property="local:BindingProxy.A"
                Value="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}, Path=IsKeyboardFocused}"/>
        <Setter Property="local:BindingProxy.B"
                Value="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <Grid>
                        <local:FZMaterial ImageSourceNoPreload="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Icon_Shadow.png" Width="108" Height="108" Margin="-18,0,0,45" HorizontalAlignment="Left" VerticalAlignment="Bottom"/>
                        <local:FZMaterial ImageSourceNoPreload="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/FloatingIconShadow.png">
                            <local:FZMaterial x:Name="FloatingIconBackground" Style="{StaticResource A_Style_FZMaterial_FloatingIcon}">
                                <local:FZMaterial x:Name="FloatingIconContent"
                                    Color="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToFloatingIconForegroundColor}, FallbackValue={StaticResource A_Color_Tile_FloatingIcon_Foreground}}"
                                    ImageSourceNoPreload="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"/>
                            </local:FZMaterial>
                        </local:FZMaterial>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <DataTrigger Binding="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource Self}}"
                         Value="{x:Static local:LockState.Locked}">
                            <Setter Property="Preset"
                                Value="{StaticResource A_FZMaterialPresetroundtangle_FlatPanel_FloatingIcon}"
                                TargetName="FloatingIconBackground" />
                            <Setter Property="Color"
                                Value="{StaticResource A_Color_Tile_FloatingIcon_Background_Locked}"
                                TargetName="FloatingIconBackground" />
                            <Setter Property="ImageSourceNoPreload"
                                Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/FloatingIcons/Locked.png" TargetName="FloatingIconContent" />
                            <Setter Property="Color"
                                Value="{StaticResource A_Color_Tile_FloatingIcon_Foreground_Locked}"
                                TargetName="FloatingIconContent" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <!-- DataTemplates -->
    <!-- Tile Functionality Styles -->
    <Style x:Key="A_Style_FZMaterial_TileShadow" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase}">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Preset">
            <Setter.Value>
                <local:FZMaterialPresetSelfShadow Softness="36" />
            </Setter.Value>
        </Setter>
        <Setter Property="Margin"
                Value="-36" />
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}, Path=IsKeyboardFocused}"
                         Value="True">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}, Path=IsKeyboardFocused}" Value="False">
                <Setter Property="Opacity" Value="0"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding DataContext.HighlightPrompt, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                         Value="{x:Static Visibility.Visible}">
                <Setter Property="Margin" Value="-36,-36,-36,-78" />
            </DataTrigger>
        </Style.Triggers>
    </Style>
    
    <Style x:Key="A_Style_FZMaterial_TileDropShadow" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase}">
        <Setter Property="IsHitTestVisible" Value="False"/>
        <Setter Property="Margin" Value="-24"/>
        <Setter Property="Opacity" Value="0"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}, Path=IsKeyboardFocusWithin}" Value="True">
                <Setter Property="Opacity" Value="1.0"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <!-- Adding an extra .5 to the stroke thickness as we were getting 'cracks' between the highlight and tile contents -->
    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_TileSelection"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangle_GradientHighlight}"
        CornerRadius="{StaticResource A_CornerRadius_Highlight_All}"
        Thickness="6.5"/>

    <local:FZMaterialPresetRoundtangleStroke x:Key="A_FZMaterialPresetRoundtangleStroke_TileSelectionWithHighlightPrompt"
        BasedOn="{StaticResource A_FZMaterialPresetRoundtangleStroke_TileSelection}"
        Thickness="6.5,6.5,6.5,48.5"/>

    <Style x:Key="A_Style_FZMaterial_TileSelectionStroke" TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Margin" Value="-6"/>
        <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangleStroke_TileSelection}"/>
        <Style.Triggers>
            <Trigger Property="local:BindingProxy.A" Value="{x:Static Visibility.Visible}">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangleStroke_TileSelectionWithHighlightPrompt}"/>
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_ContentControl_TileSelectionStroke" TargetType="{x:Type ContentControl}">
        <Setter Property="Content" Value="{Binding DataContext.HighlightPrompt, RelativeSource={RelativeSource TemplatedParent}}"/>
        <Setter Property="Focusable" Value="False"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate>
                    <local:FZMaterial x:Name="StrokeBackground"
                        Style="{StaticResource A_Style_FZMaterial_TileSelectionStroke}"
                        local:BindingProxy.A="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_HighlightShadow}"
                            VerticalAlignment="Bottom"
                            Height="48"
                            Visibility="{Binding Content, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <Decorator Margin="16,0">
                                <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TilePrompt}"
                                    local:TextBlockInlineMarkup.Markup="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />
                            </Decorator>
                        </local:FZMaterial>
                    </local:FZMaterial>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContentControl}}, Path=IsKeyboardFocused}"
                         Value="False">
                <Setter Property="Opacity"
                        Value="0" />
            </DataTrigger>
            <DataTrigger Binding="{Binding Content, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                         Value="{x:Static Visibility.Visible}">
                <Setter Property="Margin" Value="0,0,0,-42" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LockableImage"
           TargetType="local:FZMaterial">
        <Style.Triggers>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Locked}">
                <Setter Property="Opacity"
                        Value="0.0" />
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}"
                         Value="{x:Static local:LockState.Unlocked}">
                <Setter Property="Opacity"
                        Value="1.0"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_Converter_TileColorSchemeToLockableIconColor"
        Default="{StaticResource A_Color_SmallTile_Icon}">
        <local:MappingConverterEntry Key="{x:Static local:TileColorScheme.ExpansionTwo}" Value="{StaticResource A_Color_SmallTile_Icon_ExpansionTwo}"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_LockableIcon"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_PassthroughImageSourceWhilePageInitialized}">
           <Setter Property="HorizontalAlignment" Value="Left"/>
           <Setter Property="VerticalAlignment" Value="Bottom"/>
           <Setter Property="Width" Value="150"/>
           <Setter Property="Height" Value="90"/>
           <Setter Property="Color" Value="{Binding (local:TileMenuNavigationManager.TileColorScheme), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}, Converter={StaticResource A_Converter_TileColorSchemeToLockableIconColor}, FallbackValue={StaticResource A_Color_SmallTile_Icon}}"/>
           <Setter Property="local:ManualPassthroughProperty.Input" Value="{Binding DataContext.Icon, RelativeSource={RelativeSource AncestorType=Button}}"/>
           <Setter Property="Visibility" Value="{Binding ImageSource, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding UseAlternateColors}" Value="True">
                <Setter Property="Color" Value="{StaticResource A_Color_SmallTile_Icon_Alternate}"/>
            </DataTrigger>
            <DataTrigger Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource FindAncestor, AncestorType=Button}}" Value="{x:Static local:LockState.Locked}">
                <Setter Property="Color" Value="{StaticResource A_Color_SmallTile_Icon_Locked}"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZMaterial_LockableLargeIcon"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LockableIcon}">
           <Setter Property="HorizontalAlignment" Value="Center"/>
           <Setter Property="Margin" Value="60,0,0,0"/>
    </Style>

    <local:MappingConverter x:Key="A_Converter_BooleanToToggleIconImageSource"
        Default="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Toggle_Disabled.png">
        <local:MappingConverterEntry Key="True" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Toggle_Enabled.png"/>
        <local:MappingConverterEntry Key="False" Value="/ForzaUI;component/Textures/Anthem/Icons/TiledMenus/Toggle_Disabled.png"/>
    </local:MappingConverter>

    <Style x:Key="A_Style_FZMaterial_ToggleIcon"
           TargetType="local:FZMaterial"
           BasedOn="{StaticResource A_Style_FZMaterial_LockableIcon}">
        <Setter Property="HorizontalAlignment" Value="Right"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="Width" Value="90"/>
        <Setter Property="Height" Value="64"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text}"/>
        <Setter Property="ImageSource" Value="{Binding UseAlternateColors, Converter={StaticResource A_Converter_BooleanToToggleIconImageSource}}"/>
    </Style>

    <!-- ControlTemplates -->
    <ControlTemplate x:Key="A_ControlTemplate_EmptyTile"
                     TargetType="{x:Type local:FZButton}">
        <Grid Style="{StaticResource A_Style_FrameworkElement_TiledMenuTransition}">
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileShadow}" />
            <Grid Style="{StaticResource A_Style_Grid_MotionBlur}">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                <ContentPresenter />
                <ContentControl Content="{Binding DataContext.FloatingIcon, RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{StaticResource A_Style_ContentControl_FloatingIcon_Tile}"/>
                <ContentControl Content="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{DynamicResource A_Style_ContentControl_NotificationBadge_IconTile}" />
            </Grid>
            <ContentControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" />
        </Grid>
    </ControlTemplate>

    <local:FZMaterialPresetRoundtangle x:Key="A_FZMaterialPresetRoundtangle_TintPanel_OuterBottomOnly"
        CornerRadius="{StaticResource A_CornerRadius_Outer_Bottom}"/>

    <Style x:Key="A_Style_FZMaterial_TileTintedPanel_Shallow"
        TargetType="{x:Type local:FZMaterial}">
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_TintedPanel}" />
        <Setter Property="VerticalAlignment" Value="Bottom" />
        <Setter Property="Height" Value="{StaticResource A_Double_Size_Tile_TitlePanel_Shallow}" />
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_TileTitlePanel"
        TargetType="{x:Type ContentControl}">
        <Grid ClipToBounds="True" Height="{StaticResource A_Double_Size_Tile_TitlePanel}">
            <local:FZMaterial x:Name="TintedPanel"
                Color="{StaticResource A_Color_Tile_TintedPanel}"
                Visibility="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                Height="{StaticResource A_Double_Size_Tile_TitlePanel}"
                VerticalAlignment="Bottom"/>
            <ContentPresenter x:Name="PanelContent"
                Margin="{StaticResource A_Thickness_TilePadding}">
                <ContentPresenter.RenderTransform>
                    <TranslateTransform Y="0"/>
                </ContentPresenter.RenderTransform>
            </ContentPresenter>
        </Grid>
        <ControlTemplate.Resources>
            <local:UIStoryboard x:Key="A_Storyboard_TileTitlePanel_Hide_Instant">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="TintedPanel">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="PanelContent">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="{StaticResource A_Double_Size_Tile_TitlePanel}"/>
                </DoubleAnimationUsingKeyFrames>
            </local:UIStoryboard>
            <local:UIStoryboard x:Key="A_Storyboard_TileTitlePanel_Show" DurationOverride="0:0:0.333">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Height)" Storyboard.TargetName="TintedPanel"
                    FillBehavior="Stop">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="0"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0"
                        Value="{StaticResource A_Double_Size_Tile_TitlePanel}"
                        EasingFunction="{local:QuarticEasing EasingMode=EaseOut}"/>
                </DoubleAnimationUsingKeyFrames>
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.Y)" Storyboard.TargetName="PanelContent"
                    FillBehavior="Stop">
                    <EasingDoubleKeyFrame KeyTime="0:0:0.0" Value="{StaticResource A_Double_Size_Tile_TitlePanel}"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1.0"
                        Value="0"
                        EasingFunction="{local:QuarticEasing EasingMode=EaseOut}"/>
                </DoubleAnimationUsingKeyFrames>
            </local:UIStoryboard>
        </ControlTemplate.Resources>
        <ControlTemplate.Triggers>
            <Trigger Property="local:BindingProxy.A">
                <Trigger.Value>
                    <System:Boolean>True</System:Boolean>
                </Trigger.Value>
                <Setter Property="Preset"
                    TargetName="TintedPanel"
                    Value="{StaticResource A_FZMaterialPresetRoundtangle_TintPanel_OuterBottomOnly}"/>
            </Trigger>
            <DataTrigger Binding="{Binding Path=(local:UIPageTransitionManager.TransitionManager).(TransitionState), RelativeSource={RelativeSource AncestorType=Page}, FallbackValue={x:Static local:UIPageTransitionState.Idle}}"
                Value="{x:Static local:UIPageTransitionState.TransitioningInForward}">
                <DataTrigger.EnterActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_TileTitlePanel_Hide_Instant}"/>
                </DataTrigger.EnterActions>
                <DataTrigger.ExitActions>
                    <BeginStoryboard Storyboard="{StaticResource A_Storyboard_TileTitlePanel_Show}"/>
                </DataTrigger.ExitActions>
            </DataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_ContentControl_TileTitlePanel"
        TargetType="{x:Type ContentControl}">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_TileTitlePanel}"/>
        <Setter Property="Height" Value="{StaticResource A_Double_Size_Tile_TitlePanel}"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="Tag">
            <Setter.Value>
                <System:Boolean>True</System:Boolean>
            </Setter.Value>
        </Setter>
        <Setter Property="local:BindingProxy.A">
            <Setter.Value>
                <System:Boolean>True</System:Boolean>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ContentControl_TileTitlePanel_NoCorners"
        TargetType="{x:Type ContentControl}"
        BasedOn="{StaticResource A_Style_ContentControl_TileTitlePanel}">
        <Setter Property="local:BindingProxy.A">
            <Setter.Value>
                <System:Boolean>False</System:Boolean>
            </Setter.Value>
        </Setter>
    </Style>

    <System:Double x:Key="A_Double_TileTextSpacer">0</System:Double>
    <System:Double x:Key="A_Double_TileTextSpacer_JP">4</System:Double>
    <System:Double x:Key="A_Double_TileTextSpacer_CHS">4</System:Double>
    <System:Double x:Key="A_Double_TileTextSpacer_CHT">4</System:Double>
    
    <ControlTemplate x:Key="A_ControlTemplate_BorderedTile"
                     TargetType="{x:Type local:FZButton}">
        <Grid Style="{StaticResource A_Style_FrameworkElement_TiledMenuTransition}">
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileShadow}" />
            <Grid Style="{StaticResource A_Style_Grid_MotionBlur}">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                <Grid Margin="{StaticResource A_Thickness_TileBorderedBackground}">
                    <ContentPresenter />
                </Grid>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoAlternate}"
                        Preset="{StaticResource A_FZMaterialPresetRoundtangleStroke_TileBackground_BorderedImage}"/>
                <ContentControl x:Name="TitlePanelControl"
                    Style="{StaticResource A_Style_ContentControl_TileTitlePanel}"
                    Tag="{StaticResource A_Boolean_False}">
                    <StackPanel Orientation="Vertical"
                        VerticalAlignment="Center">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                            HorizontalAlignment="Center"/>
                        <Decorator Height="{local:LocalizedResource A_Double_TileTextSpacer}"/>
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileText_ImageTile}"
                            HorizontalAlignment="Center"/>
                    </StackPanel>
                </ContentControl>
                <ContentControl Content="{Binding DataContext.FloatingIcon, RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{StaticResource A_Style_ContentControl_FloatingIcon_Tile}"/>
                <ContentControl Content="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{DynamicResource A_Style_ContentControl_NotificationBadge_ImageTile}" />
                <Control x:Name="NewCornerBanner"
                         Style="{StaticResource A_Style_Control_NewBanner_ImageTile}" 
                         Visibility="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
            </Grid>
            <ContentControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" />
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Heading, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                    <Condition Binding="{Binding Description, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed" TargetName="TitlePanelControl"/>
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_BorderedEdgeOnlyTile"
                     TargetType="{x:Type local:FZButton}">
        <Grid Style="{StaticResource A_Style_FrameworkElement_TiledMenuTransition}">
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileShadow}" />
            <Grid Style="{StaticResource A_Style_Grid_MotionBlur}">
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_MotionBlurExpander}" />
                <Grid Margin="{StaticResource A_Thickness_TileEdgeBorderOnly}">
                    <ContentPresenter />
                </Grid>
                <ContentControl x:Name="TitlePanelControl"
                    Style="{StaticResource A_Style_ContentControl_TileTitlePanel}"
                    Tag="{StaticResource A_Boolean_True}">
                    <StackPanel Orientation="Vertical"
                        VerticalAlignment="Center">
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileTitle_Alternate}"
                            HorizontalAlignment="Center"/>
                        <Decorator Height="{local:LocalizedResource A_Double_TileTextSpacer}"/>
                        <local:FZTextBlock Style="{StaticResource A_Style_FZTextBlock_TileText_ImageTile_Alternate}"
                            HorizontalAlignment="Center"/>
                    </StackPanel>
                </ContentControl>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoAlternate}"
                        Preset="{StaticResource A_FZMaterialPresetRoundtangleStroke_TileBackground_EdgeBorderOnly}"/>
                <ContentControl Content="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                                Style="{DynamicResource A_Style_ContentControl_NotificationBadge_ImageTile}" />
            </Grid>
            <ContentControl Style="{StaticResource A_Style_ContentControl_TileSelectionStroke}" />
        </Grid>
        <ControlTemplate.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Heading, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                    <Condition Binding="{Binding Description, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Collapsed}"/>
                </MultiDataTrigger.Conditions>
                <Setter Property="Visibility" Value="Collapsed" TargetName="TitlePanelControl"/>
            </MultiDataTrigger>
        </ControlTemplate.Triggers>
    </ControlTemplate>

    <Style x:Key="A_Style_FZMaterial_LockableVideoTileBackground_NoCorners" TargetType="{x:Type local:FZMaterial}" BasedOn="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_NoCorners}">
        <Setter Property="Stretch" Value="Fill"/>
    </Style>

    <Style x:Key="A_Style_FZMediaElement_Video" TargetType="{x:Type local:FZMediaElement}">
        <Setter Property="Visibility" Value="Collapsed"/>
        <Setter Property="Stretch" Value="Fill"/>
        <Style.Triggers>
            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding Opacity, RelativeSource={RelativeSource AncestorType=Button}}" Value="1.0"/>
                    <Condition Binding="{Binding (local:TileMenuNavigationManager.LockState), RelativeSource={RelativeSource AncestorType=Button}}" Value="{x:Static local:LockState.Unlocked}"/>
                    <Condition Binding="{Binding IsCurrentlyActive, RelativeSource={RelativeSource AncestorType=Page}}" Value="True"/>
                </MultiDataTrigger.Conditions>
                <MultiDataTrigger.EnterActions>
                    <local:CommandAction CommandPropertyName="PlayVideoTile"
                                         AncestorType="Page" />
                </MultiDataTrigger.EnterActions>
                <MultiDataTrigger.ExitActions>
                    <local:CommandAction CommandPropertyName="StopVideoTile"
                                         AncestorType="Page" />
                </MultiDataTrigger.ExitActions>
                <Setter Property="Visibility" Value="Visible"/>
            </MultiDataTrigger>
        </Style.Triggers>
    </Style>

    <Size x:Key="A_Size_PlayerListItem_GamerPicSizeParams">105,105</Size>

    <DataTemplate x:Key="A_DataTemplate_PlayerListItem_Gamerpic">
        <Grid ClipToBounds="True"
              Height="94.5"
              Width="105">
            <local:FZMaterial ImageSource="{Binding Player, Converter={StaticResource A_GamerPicOrTeamProfileConverter}, ConverterParameter={StaticResource A_Size_PlayerListItem_GamerPicSizeParams}}"
                              Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                              HorizontalAlignment="Center"
                              VerticalAlignment="Center"
                              Height="105"
                              Width="105" />
        </Grid>
    </DataTemplate>

    <!-- Tile Styles -->
    <Style x:Key="A_Style_Button_EmptyTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_RootTile}" >
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_EmptyTile}" />
    </Style>

    <Style x:Key="A_Style_Button_BorderedTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_RootTile}" >
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_BorderedTile}" />
    </Style>

    <Style x:Key="A_Style_Button_BorderedEdgeOnlyTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_RootTile}" >
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_BorderedEdgeOnlyTile}" />
    </Style>

    <Style x:Key="A_Style_Button_PlayerListTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedTile}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_Interactive}">
                        <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                            <local:FZMaterial ImageSourceNoPreload="/ForzaUI;component/Textures/Anthem/PauseMenuTileBackgrounds/PlayerListBackground.png" />
                            <ItemsControl DockPanel.Dock="Top"
                                          ItemsSource="{Binding Players}"
                                          ItemTemplate="{StaticResource A_DataTemplate_PlayerListItem_Gamerpic}">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <WrapPanel IsItemsHost="True" />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                            </ItemsControl>
                        </Grid>
                    </local:FZMaterial>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <DataTrigger Binding="{Binding Path=(local:UIPageTransitionManager.TransitionManager).(TransitionState), RelativeSource={RelativeSource AncestorType=Page}, FallbackValue={x:Static local:UIPageTransitionState.Idle}}"
                         Value="{x:Static local:UIPageTransitionState.TransitioningInForward}">
                <DataTrigger.EnterActions>
                    <local:CommandAction AncestorType="local:FZButton"
                                         UseAncestorDataContext="True"
                                         CommandPropertyName="RefreshCommand" />
                </DataTrigger.EnterActions>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_TileText_NameText" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_IconTile}"/>

    <Style x:Key="A_Style_FZTextBlock_TileText_NameText_CHS" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_IconTile}">
        <Setter Property="LineAdjust" Value="0.08"/>
    </Style>
    <Style x:Key="A_Style_FZTextBlock_TileText_NameText_CHT" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_IconTile}">
        <Setter Property="LineAdjust" Value="0.08"/>
    </Style>
    <Style x:Key="A_Style_FZTextBlock_TileText_NameText_JP" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_TileText_IconTile}">
        <Setter Property="LineAdjust" Value="0.04"/>
    </Style>

    <Style x:Key="A_Style_Button_IconTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_EmptyTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="9" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="4" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground}"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableIcon}"/>
                        <Decorator Margin="{StaticResource A_Thickness_TilePadding_IconTile}">
                            <local:FZTextBlock x:Name="NameText" 
                                               Style="{local:LocalizedResource A_Style_FZTextBlock_TileText_NameText}"/>
                        </Decorator>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_Button_ToggleIconTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_EmptyTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="13" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="4" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground}"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableIcon}"/>
                        <StackPanel Orientation="Vertical"
                            HorizontalAlignment="Left"
                            VerticalAlignment="Center"
                            MaxWidth="198"
                            Margin="{StaticResource A_Thickness_TilePadding_IconTile}">
                            <local:FZTextBlock x:Name="NameText"
                                Style="{local:LocalizedResource A_Style_FZTextBlock_TileText_NameText}"/>
                        </StackPanel>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_ToggleIcon}"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_Button_LargeIconTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="13" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="8" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground_NoCornersTinted}"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableLargeIcon}"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <DataTemplate x:Key="A_ContentTemplate_Button_ImageTile">
        <local:FZMaterial DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}"
            Style="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_NoCorners}"/>
    </DataTemplate>

    <Style x:Key="A_Style_Button_ImageTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedTile}" >
        <Setter Property="ContentTemplate" Value="{StaticResource A_ContentTemplate_Button_ImageTile}"/>
    </Style>

    <Style x:Key="A_Style_Button_VideoTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedEdgeOnlyTile}" >
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableVideoTileBackground_NoCorners}"/>
                        <local:FZMediaElement Style="{StaticResource A_Style_FZMediaElement_Video}"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_Button_MainEmptyTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_EmptyTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="30" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="local:TileMenuNavigationManager.InitialSelection" Value="True" />
    </Style>

    <Style x:Key="A_Style_Button_MainBorderedTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="30" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="local:TileMenuNavigationManager.InitialSelection" Value="True" />
    </Style>

    <Style x:Key="A_Style_Button_MainBorderedEdgeOnlyTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedEdgeOnlyTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="30" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="local:TileMenuNavigationManager.InitialSelection" Value="True" />
    </Style>

    <Style x:Key="A_Style_Button_MainImageTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_MainBorderedEdgeOnlyTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="30" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="local:TileMenuNavigationManager.InitialSelection" Value="True" />
        <Setter Property="ContentTemplate" Value="{StaticResource A_ContentTemplate_Button_ImageTile}"/>
    </Style>

    <Style x:Key="A_Style_Button_MainVideoTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_VideoTile}" >
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="30" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="local:TileMenuNavigationManager.InitialSelection" Value="True" />
    </Style>

    <Style x:Key="A_Style_Button_ShowroomLiveTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_BorderedTile}">
        <Style.Resources>
            <Size x:Key="A_Size_ShowroomLiveTile_GamerPicSizeParams">300,285</Size>
        </Style.Resources>
        <Setter Property="local:TileMenuNavigationManager.GridWidth" Value="13" />
        <Setter Property="local:TileMenuNavigationManager.GridHeight" Value="16" />
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_GlassPanel_Interactive}"/>
                        <local:FZMaterial x:Name="GamerPicMaterial"
                            Style="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_NoCorners}"
                            ImageSource="{Binding UserProfile, Converter={StaticResource A_GamerPicConverter}, ConverterParameter={StaticResource A_Size_ShowroomLiveTile_GamerPicSizeParams}}"
                            Visibility="{Binding Downloaded, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter_UseHidden}}"/>
                        <ProgressBar Style="{StaticResource A_Style_ProgressBar_WaitSpinner}"
                            HorizontalAlignment="Center"
                            VerticalAlignment="Center"
                            Visibility="{Binding Downloaded, ElementName=GamerPicMaterial, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}, FallbackValue={x:Static Visibility.Hidden}}"/>
                        <StackPanel Margin="13,13,0,0"
                            Orientation="Vertical"
                            HorizontalAlignment="Left"
                             VerticalAlignment="Top">
                             <Decorator Visibility="{Binding ShowTunerLevel, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                                Margin="0,0,0,6">
                                <Control Template="{StaticResource A_ControlTemplate_RankLevel_Pill}" 
                                    Tag="{x:Static local:UGCThreadType.Tuning}"
                                    DataContext="{Binding UserProfile}"/>
                             </Decorator>
                             <Decorator Visibility="{Binding ShowPainterLevel, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                <Control Template="{StaticResource A_ControlTemplate_RankLevel_Pill}" 
                                    Tag="{x:Static local:UGCThreadType.Livery}"
                                    DataContext="{Binding UserProfile}"/>
                             </Decorator>
                        </StackPanel>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_Button_CharacterSelectTile"
        TargetType="{x:Type local:FZButton}"
        BasedOn="{StaticResource A_Style_Button_ImageTile}">
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <Grid DataContext="{Binding DataContext, RelativeSource={RelativeSource AncestorType={x:Type local:FZButton}}}">
                        <local:FZMaterial Preset="{StaticResource A_FZMaterialPresetRoundtangle_CharacterSelect_Background}"/>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_LockableImageTileBackground_NoCorners}"/>
                    </Grid>
                </DataTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  
    <!-- Tab bar -->
    <Style x:Key="A_Style_Button_TabTitleRB_TiledMenus"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_TabTitleRB}">
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="OnClickSoundName"
                Value="" />
        <Setter Property="Command"
                Value="{Binding NextGroupCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}" />
        <Setter Property="IsEnabled"
                Value="{Binding CanSelectNextGroup, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}" />
    </Style>

    <Style x:Key="A_Style_Button_TabTitleLB_TiledMenus"
           TargetType="{x:Type local:FZButton}"
           BasedOn="{StaticResource A_Style_Button_TabTitleLB}">
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="OnClickSoundName"
                Value="" />
        <Setter Property="Command"
                Value="{Binding PrevGroupCommand, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}"/>
        <Setter Property="IsEnabled"
                Value="{Binding CanSelectPrevGroup, RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}" />
    </Style>

    <Style TargetType="{x:Type ContentControl}"
           x:Key="A_Style_ContentControl_TabTitle_Default">
        <Style.Resources>
            <Thickness x:Key="A_Thickness_TabTitle_TextMargin_Dynamic">24,12</Thickness>
        </Style.Resources>
        <Setter Property="Focusable"
                Value="False" />
        <Setter Property="local:ScreenReader.SelectedNumber"
                Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}"/>
        <Setter Property="local:ScreenReader.SelectedCount"
                Value="{Binding Items.Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}, FallbackValue=0}"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ContentControl}">
                    <local:FZMaterial x:Name="Divider" Color="{StaticResource A_Color_TabBar_ItemDivider}">
                        <Grid x:Name="OuterGrid" Margin="1,0">
                            <local:RoutedEventCommand x:Name="ClickOnMouseItem"
                                                        RoutedEvent="UIElement.MouseLeftButtonUp"
                                                        Command="{Binding SelectGroup, RelativeSource={RelativeSource AncestorType=Page}}"/>

                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_TabBarItem}"
                                              Height="{StaticResource A_Double_Size_TabMenuItemHeight}"
                                              VerticalAlignment="Bottom"
                                              local:RoutedEventCommand.Action="{Binding ElementName=ClickOnMouseItem}"
                                              x:Name="FZMaterial_Background">
                                <Grid x:Name="InnerGrid" Margin="0">
                                    <local:FZMaterial x:Name="FZMaterial_Shadow"
                                        Style="{StaticResource A_Style_FZMaterial_HighlightShadow}"
                                        CaptureSubgraph="False">
                                        <local:FZTextBlock Color="{StaticResource A_Color_TabBar_ItemText}"
                                                   FontSize="{StaticResource A_Double_FontSize_TabMenu}"
                                                   Margin="{DynamicResource A_Thickness_TabTitle_TextMargin_Dynamic}"
                                                   Stretch="Uniform"
                                                   Style="{StaticResource A_Style_FZTextBlock_HorizonA}"
                                                   Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}"
                                                   TextWrapping="NoWrap"
                                                   TextAlignment="Center"
                                                   VerticalAlignment="Center"
                                                   MaxWidth="300"
                                                   x:Name="Textblock_Title"
                                                   IsHitTestVisible="False"
                                                   local:ScreenReader.Event="OnChange"
                                                   local:ScreenReader.LineType="SelectedGroup"
                                                   local:ScreenReader.SelectedNumber="{Binding (local:ScreenReader.SelectedNumber), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"
                                                   local:ScreenReader.SelectedCount="{Binding (local:ScreenReader.SelectedCount), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}}"/>
                                    </local:FZMaterial>
                                </Grid>
                            </local:FZMaterial>
                            <Control x:Name="MouseRollover"
                                     Style="{StaticResource A_Style_Control_MouseRollover}" />

                            <ContentControl Content="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"
                                                HorizontalAlignment="Right"
                                                Style="{StaticResource A_Style_ContentControl_NotificationBadge}"
                                                VerticalAlignment="Top"
                                                Margin="0,-25,-2,0" Panel.ZIndex="2"
                                                x:Name="Badge" />

                        </Grid>
                    </local:FZMaterial>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsFocused"
                                 Value="True">
                            <Setter Property="local:BindingProxy.A">
                                <Setter.Value>
                                    <System:Boolean>True</System:Boolean>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger Property="Selector.IsSelected"
                                 Value="True">
                            <Setter Property="local:BindingProxy.A">
                                <Setter.Value>
                                    <System:Boolean>True</System:Boolean>
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <DataTrigger Binding="{Binding Path=(Selector.IsSelected), RelativeSource={RelativeSource FindAncestor, AncestorType=ContentControl}}"
                                 Value="True">
                            <Setter Property="local:BindingProxy.A">
                                <Setter.Value>
                                    <System:Boolean>True</System:Boolean>
                                </Setter.Value>
                            </Setter>
                        </DataTrigger>

                        <Trigger Property="local:BindingProxy.A">
                            <Trigger.Value>
                                <System:Boolean>True</System:Boolean>
                            </Trigger.Value>
                            <Setter Property="Style"
                                    TargetName="FZMaterial_Background"
                                    Value="{StaticResource A_Style_FZMaterial_FlatPanel_TabBarHighlight}" />
                            <Setter Property="CaptureSubgraph"
                                    TargetName="FZMaterial_Shadow"
                                    Value="True" />
                            <Setter Property="Color"
                                    TargetName="Textblock_Title"
                                    Value="{StaticResource A_Color_TabBar_ItemText_Selected}" />
                            <Setter Property="Margin"
                                    TargetName="OuterGrid"
                                    Value="0,0" />
                            <Setter Property="Margin"
                                    TargetName="InnerGrid"
                                    Value="1,0" />
                            <Setter Property="Opacity"
                                    Value="1" />
                            <Setter TargetName="MouseRollover"
                                    Property="Opacity"
                                    Value="0" />
                            <Setter TargetName="Badge"
                                    Property="Margin"
                                    Value="0,-25,-1,0"/>
                            <Setter TargetName="Textblock_Title"
                                    Property="local:ScreenReader.Line"
                                    Value="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />
                        </Trigger>
                        <Trigger Property="local:TileMenuNavigationManager.TileState"
                                 Value="{x:Static local:TileState.Disabled}">
                            <Setter Property="Style"
                                    TargetName="FZMaterial_Background"
                                    Value="{StaticResource A_Style_FZMaterial_GlassPanel_TabBarItem_Disabled}" />
                            <Setter Property="Opacity"
                                    TargetName="Textblock_Title"
                                    Value="0.25" />
                            <Setter Property="Color"
                                    TargetName="Textblock_Title"
                                    Value="{StaticResource A_Color_Tile_Title_Alternate}" />
                            <Setter Property="Margin"
                                    TargetName="OuterGrid"
                                    Value="0,0" />
                            <Setter Property="Margin"
                                    TargetName="InnerGrid"
                                    Value="1,0" />

                        </Trigger>
                        <MultiTrigger>
                            <MultiTrigger.Conditions>
                                <Condition Property="IsMouseOver"
                                           Value="True"/>
                                <Condition Property="local:TileMenuNavigationManager.TileState"
                                           Value="{x:Static local:TileState.Enabled}"/>
                            </MultiTrigger.Conditions>
                            <Setter TargetName="MouseRollover"
                                    Property="Visibility"
                                    Value="Visible" />
                            <Setter Property="Margin"
                                    TargetName="OuterGrid"
                                    Value="0,0" />
                            <Setter Property="Margin"
                                    TargetName="InnerGrid"
                                    Value="1,0" />
                            <Setter TargetName="Badge"
                                    Property="Margin"
                                    Value="0,-25,-1,0"/>
                        </MultiTrigger>
                        <DataTrigger Binding="{Binding SelectGroup, RelativeSource={RelativeSource AncestorType=Page}}"
                                     Value="{x:Null}">
                            <Setter TargetName="ClickOnMouseItem"
                                    Property="Command"
                                    Value="{Binding OnItemLeftMouseUp, RelativeSource={RelativeSource AncestorType=Selector}}" />
                        </DataTrigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_ContentControl_TabTitle_NonCarousel"
        TargetType="{x:Type ContentControl}"
        BasedOn="{StaticResource A_Style_ContentControl_TabTitle_Default}">
        <Setter Property="local:FindSelfIndexInCollection.Collection"
                Value="{Binding (local:AccumulateSelfOnParent.Output), RelativeSource={RelativeSource AncestorType={x:Type Selector}}}" />
        <Setter Property="local:ScreenReader.SelectedNumber"
                Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}" />
        <Setter Property="local:ScreenReader.SelectedCount"
                Value="{Binding (local:AccumulateSelfOnParent.Output).Count, RelativeSource={RelativeSource AncestorType={x:Type Selector}}, FallbackValue=0}" />
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="local:TileMenuNavigationManager.TileState" Value="{x:Static local:TileState.Enabled}"/>
                    <Condition Property="Visibility" Value="{x:Static Visibility.Visible}"/>
                </MultiTrigger.Conditions>
                <Setter Property="local:AccumulateSelfOnParent.ParentType"
                        Value="{x:Type Selector}"/>
                <Setter Property="local:AccumulateSelfOnParent.SortOrder"
                        Value="{Binding (ItemsControl.AlternationIndex), RelativeSource={RelativeSource AncestorType={x:Type ContentControl}}, FallbackValue=-1}" />
            </MultiTrigger>
        </Style.Triggers>
   </Style>

    <Style x:Key="A_Style_ContentControl_TabTitle_TiledMenus"
        TargetType="{x:Type ContentControl}"
        BasedOn="{StaticResource A_Style_ContentControl_TabTitle_Default}">
        <Setter Property="local:FindSelfIndexInCollection.Collection"
                Value="{Binding (local:AccumulateSelfOnParent.Output), ElementName=PART_MenuGroups}" />
        <Setter Property="local:ScreenReader.SelectedNumber"
                Value="{Binding (local:FindSelfIndexInCollection.Index), RelativeSource={RelativeSource Self}, Converter={StaticResource A_IndexToNumberConverter}, FallbackValue=0}" />
        <Setter Property="local:ScreenReader.SelectedCount"
                Value="{Binding (local:AccumulateSelfOnParent.Output).Count, ElementName=PART_MenuGroups, FallbackValue=0}" />
        <Style.Triggers>
            <MultiTrigger>
                <MultiTrigger.Conditions>
                    <Condition Property="local:TileMenuNavigationManager.TileState" Value="{x:Static local:TileState.Enabled}"/>
                    <Condition Property="Visibility" Value="{x:Static Visibility.Visible}"/>
                </MultiTrigger.Conditions>
                <Setter Property="local:AccumulateSelfOnParent.ParentName"
                        Value="PART_MenuGroups" />
            </MultiTrigger>
        </Style.Triggers>
   </Style>

    <Style x:Key="A_Style_FZMaterial_InfoBoxShadow"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase_ForSubgraph}">
        <Setter Property="Margin" Value="-6"/>
        <Setter Property="Preset">
            <Setter.Value>
                <local:FZMaterialPresetRoundtangle Softness="15" CornerRadius="8" AlphaMode="MultiplyInvColorOnly" Unlit="True" />
            </Setter.Value>
        </Setter>
    </Style>

    <ControlTemplate x:Key="A_ControlTemplate_InfoBoxWithIcon"
                     TargetType="{x:Type ContentControl}">
        <Grid>
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_InfoBoxShadow}"/>
            <DockPanel>
                <local:FZMaterial DockPanel.Dock="Left"
                    Width="{TemplateBinding Height}"
                    Style="{StaticResource A_Style_FZMaterial_FlatPanel_LeftHeaderPanel}"
                    Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerLeftOnly}">
                    <local:FZMaterial ImageSource="{Binding Tag, RelativeSource={RelativeSource TemplatedParent}}"/>
                </local:FZMaterial>
                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}"
                    Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerRightOnly}">
                    <ContentPresenter Margin="12,6"/>
                </local:FZMaterial>
            </DockPanel>
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="A_ControlTemplate_InfoBox"
                     TargetType="{x:Type ContentControl}">
        <Grid>
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_InfoBoxShadow}"/>
            <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_HeaderPill}"
                Preset="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}">
                <ContentPresenter Margin="12,10"/>
            </local:FZMaterial>
        </Grid>
    </ControlTemplate>

    <Style x:Key="A_Style_ContentControl_InfoBox"
        TargetType="{x:Type ContentControl}">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_InfoBox}"/>
        <Setter Property="Height" Value="58"/>
    </Style>

    <Style x:Key="A_Style_ContentControl_InfoBoxWithIcon"
        TargetType="{x:Type ContentControl}">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_InfoBoxWithIcon}"/>
        <Setter Property="Height" Value="48"/>
        <Setter Property="Margin" Value="0,0,6,6"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_InfoBox_Title"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="FontSize" Value="20"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Header_Text}"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_InfoBox_Value"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonB}">
        <Setter Property="FontSize" Value="24"/>
        <Setter Property="HorizontalAlignment" Value="Center"/>
        <Setter Property="VerticalAlignment" Value="Bottom"/>
        <Setter Property="Color" Value="{StaticResource A_Color_Header_Text}"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_InfoBoxWithIcon_Title"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_InfoBox_Title}">
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_InfoBoxWithIcon_Value"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_InfoBox_Value}">
        <Setter Property="Color" Value="{StaticResource A_Color_Tile_Text}"/>
        <Setter Property="HorizontalAlignment" Value="Left"/>
    </Style>

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

    <ControlTemplate x:Key="A_ControlTemplate_TileCountdown"
        TargetType="{x:Type Control}">
        <Grid>
            <local:FZMaterial Height="178" Opacity="0.6">
                <local:FZMaterial.Preset>
                    <local:FZMaterialPresetRoundtangle CornerRadius="{StaticResource A_CornerRadius_Outer_Top}"
                        GradientColorA="#00000000"
                        GradientColorB="#FF000000"
                        GradientAngle="0"/>
                </local:FZMaterial.Preset>
            </local:FZMaterial>
            <DockPanel Margin="{StaticResource A_Thickness_TilePadding_IconTile}"
                HorizontalAlignment="Left"
                VerticalAlignment="Top"
                Height="58">
                <local:FZMaterial DockPanel.Dock="Left"
                    Width="58"
                    ImageSource="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}}"
                    Visibility="{Binding (local:BindingProxy.A), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                    Margin="0,0,10,0"/>
                <Grid Margin="0,6,0,6">
                    <local:FZTextBlock Text="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource A_StringToUpper}}"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        CapHeight="17"
                        Color="{StaticResource A_Color_Header_Text}"
                        Style="{StaticResource A_Style_FZTextBlock_HorizonA}"/>
                    <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding (local:BindingProxy.C), RelativeSource={RelativeSource TemplatedParent}}"
                        local:TextBlockInlineMarkup.ResourceBaseName="A_Style_Run_TileCountdown_"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Bottom"
                        CapHeight="19"
                        Color="{StaticResource A_Color_Header_Text}"
                        Style="{StaticResource A_Style_FZTextBlock_HorizonB}"/>
                </Grid>
            </DockPanel>
        </Grid>
    </ControlTemplate>

    <Style x:Key="A_Style_Control_TileCountdown"
        TargetType="{x:Type Control}">
        <Setter Property="Template" Value="{StaticResource A_ControlTemplate_TileCountdown}"/>
        <Setter Property="VerticalAlignment" Value="Top"/>
    </Style>

    <Style x:Key="A_Style_AutoScrollPanel_PauseMenuBase" TargetType="local:AutoScrollPanel">
        <Setter Property="ScrollType" Value="Speed" />
        <Setter Property="ScrollSeparation" Value="46" />
        <Setter Property="Speed" Value="40.0" />
        <Setter Property="InitialPause" Value="0:0:2.0" />
        <Setter Property="ClipToBounds" Value="True" />
        <Setter Property="Orientation" Value="Horizontal" />
        <Setter Property="AllowScrolling" Value="True"/>
        <Setter Property="Margin" Value="0,-6"/> <!-- To avoid cutting off text due to clipping. -->
        <Setter Property="Height" Value="28"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:AutoScrollPanel">
                    <local:CommonListBox Style="{StaticResource A_Style_ListBox_AutoScrollPanel}" VerticalAlignment="Center">
                        <ListBox.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="{Binding Orientation, RelativeSource={RelativeSource FindAncestor, AncestorType=local:AutoScrollPanel}}"
                                IsItemsHost="True"
                                Focusable="False"
                                HorizontalAlignment="Left"
                                VerticalAlignment="Top"/>
                            </ItemsPanelTemplate>
                        </ListBox.ItemsPanel>
                        <Control x:Name="ItemFirst" Template="{DynamicResource A_ControlTemplate_AutoscrollTemplate_Dynamic}"/>
                        <Decorator x:Name="DecoratorFirst"  Width="{Binding ScrollSeparation, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
                        <Control x:Name="ItemSecond" Template="{DynamicResource A_ControlTemplate_AutoscrollTemplate_Dynamic}" Visibility="Collapsed"/>
                        <Decorator x:Name="DecoratorSecond" Width="{Binding ScrollSeparation, RelativeSource={RelativeSource TemplatedParent}}" Visibility="Collapsed"/>
                    </local:CommonListBox>
                    <ControlTemplate.Triggers>
                        <Trigger Property="RequiresScrolling" Value="True">
                            <Setter TargetName="DecoratorFirst" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="ItemSecond" Property="Visibility" Value="Visible"/>
                            <Setter TargetName="DecoratorSecond" Property="Visibility" Value="Visible"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="A_Style_FZTextBlock_RadioArtistName"
        TargetType="{x:Type local:FZTextBlock}"
        BasedOn="{StaticResource A_Style_FZTextBlock_HorizonA}">
        <Setter Property="Color" Value="{StaticResource A_Color_TileMenu_RadioArtistName}"/>
        <Setter Property="FontSize" Value="24"/>
        <Setter Property="TextWrapping" Value="NoWrap"/>
        <Setter Property="Stretch" Value="None"/>
        <Setter Property="Text" Value="{Binding CurrentRadioArtistName}"/>
    </Style>

    <Style x:Key="A_Style_AutoScrollPanel_RadioArtistTitle"
        TargetType="local:AutoScrollPanel"
        BasedOn="{StaticResource A_Style_AutoScrollPanel_PauseMenuBase}">
        <Style.Resources>
            <ControlTemplate x:Key="A_ControlTemplate_AutoscrollTemplate_Dynamic">
                <local:FZTextBlock x:Name="ArtistName"
                    Style="{StaticResource A_Style_FZTextBlock_RadioArtistName}"
                    TextAlignment="Left"
                    HorizontalAlignment="Left"/>
            </ControlTemplate>
        </Style.Resources>
        <Setter Property="AnimationContext" Value="{Binding CurrentRadioArtistName}" />
    </Style>

    <Style x:Key="A_Style_FZMaterial_RadioAlbumArt"
        TargetType="{x:Type local:FZMaterial}"
        BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_TileLeft}">
        <Setter Property="Width" Value="138"/>
        <Setter Property="Height" Value="138"/>
        <Setter Property="ImageSourceNoPreload" Value="{Binding CurrentRadioAlbumArt}"/>
        <Style.Triggers>
            <DataTrigger Binding="{Binding CurrentRadioAlbumArt, Converter={StaticResource A_StringVisConverter}}" Value="{x:Static Visibility.Collapsed}">
                <Setter Property="ImageSourceNoPreload" Value="/ForzaUI;component/Textures/Data_Bound/AlbumArt/Horizon_Album_Artwork.png"/>
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <local:MappingConverter x:Key="A_Converter_NowPlayingRadioStationImageSources"
        Default="/ForzaUI;component/Textures/Data_Bound/DebugOnly/Placeholder_Radio_Logo.png">
        <local:MappingConverterEntry Key="StationOff" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Off.png"/>
        <local:MappingConverterEntry Key="Horizon XS" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Horizon_XS.png"/>
        <local:MappingConverterEntry Key="Horizon Bass Arena" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Horizon_Bass_Arena.png"/>
        <local:MappingConverterEntry Key="Horizon Block Party" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Horizon_Block_Party.png"/>
        <local:MappingConverterEntry Key="Horizon Pulse" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Horizon_Pulse.png"/>
        <local:MappingConverterEntry Key="Timeless FM" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Timeless.png"/>
        <local:MappingConverterEntry Key="Hospital Records" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Hospital.png"/>
        <local:MappingConverterEntry Key="Streamer Mode" Value="/ForzaUI;component/Textures/Data_Bound/RadioStations/Radio_Logo_Streamer_Mode.png"/>
        <local:MappingConverterEntry Key="Radio Awesome" Value="/ForzaUI;component/Textures/Data_Bound/PDLC2/RadioStations/Radio_Logo_Radio_Awesome.png"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_WeatherTypeImageSources"
        Default="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/ClearDay.png">
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.ClearDay}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/ClearDay.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.ClearNight}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/ClearNight.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Cloudy}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/Cloudy.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Overcast}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/Overcast.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.LightRain}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/LightRain.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.HeavyRain}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/HeavyRain.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.LightSnow}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/LightSnow.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.HeavySnow}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/HeavySnow.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Blizzard}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/Blizzard.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Fog}" Value="/ForzaUI;component/Textures/Data_Bound/WeatherTypes/Fog.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Lightning}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC1/Weather/Pause_Lightning.png"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Aurora}" Value="/ForzaUI;component/Textures/Data_Bound/PDLC1/Weather/Pause_Aurora.png"/>
    </local:MappingConverter>

    <local:MappingConverter x:Key="A_Converter_WeatherTypeStrings"
        Default="{local:Loc InGame.IDS_Weather_Clear}">
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.ClearDay}" Value="{local:Loc InGame.IDS_Weather_Clear}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.ClearNight}" Value="{local:Loc InGame.IDS_Weather_Clear}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Cloudy}" Value="{local:Loc InGame.IDS_Weather_Cloudy}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Overcast}" Value="{local:Loc InGame.IDS_Weather_Overcast}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.LightRain}" Value="{local:Loc InGame.IDS_Weather_LightRain}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.HeavyRain}" Value="{local:Loc InGame.IDS_Weather_HeavyRain}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.LightSnow}" Value="{local:Loc InGame.IDS_Weather_LightSnow}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.HeavySnow}" Value="{local:Loc InGame.IDS_Weather_HeavySnow}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Blizzard}" Value="{local:Loc InGame.IDS_Weather_Blizzard}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Fog}" Value="{local:Loc InGame.IDS_Weather_Fog}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Lightning}" Value="{local:Loc InGame.IDS_Weather_Lightning}"/>
        <local:MappingConverterEntry Key="{x:Static local:UIWeatherType.Aurora}" Value="{local:Loc InGame.IDS_Weather_Aurora}"/>
    </local:MappingConverter>

    <Style TargetType="{x:Type Canvas}"
           x:Key="A_Canvas_BaseMenu">
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="RenderTransform">
            <Setter.Value>
                <TransformGroup>
                    <ScaleTransform />
                    <SkewTransform />
                    <RotateTransform />
                    <TranslateTransform X="0" />
                </TransformGroup>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type local:ControllerButtonControl}"
           x:Key="A_Style_ControllerButtonControl_PauseMenuX"
           BasedOn="{StaticResource A_Style_ControllerButtonControl_Default}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding IsPC, RelativeSource={RelativeSource AncestorType=Page}}"
                         Value="True">
                <Setter Property="Description"
                        Value="{local:Loc HelpButtons.IDS_ResetCarPosition}" />
            </DataTrigger>
        </Style.Triggers>

        <Setter Property="Description"
                Value="{local:Loc HelpButtons.IDS_Help}" />
    </Style>

    <DataTemplate x:Key="A_DataTemplate_PauseWeather">
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground}">
            <DockPanel>
                <local:FZMaterial DockPanel.Dock="Right"
                    Height="138"
                    Width="138"
                    Color="#14FFFFFF"
                    Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}">
                    <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_TileRight}"
                        ImageSource="{Binding CurrentWeatherType, Converter={StaticResource A_Converter_WeatherTypeImageSources}}">
                    </local:FZMaterial>
                </local:FZMaterial>
                <Grid Margin="{StaticResource A_Thickness_TilePadding}">
                    <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding CurrentWeatherType, Converter={StaticResource A_Converter_WeatherTypeStrings}}"
                        Style="{StaticResource A_Style_FZTextBlock_TileText}"
                        Color="#DCFFFFFF"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"/>
                    <Viewbox Margin="-4,0,0,0"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Bottom"
                        StretchDirection="DownOnly">
                        <StackPanel Orientation="Horizontal">
                            <local:FZTextBlock Text="{Binding CurrentTemperature}"
                                Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                                CapHeight="61"
                                Color="#FF00B592"
                                Stretch="None"/>
                            <local:FZTextBlock Text="{Binding CurrentTemperatureUnit}"
                                Style="{StaticResource A_Style_FZTextBlock_TileTitle}"
                                CapHeight="42"
                                Color="#FF00B592"
                                VerticalAlignment="Top"
                                Stretch="None"/>
                        </StackPanel>
                    </Viewbox>
                </Grid>
            </DockPanel>
        </local:FZMaterial>
    </DataTemplate>

    <DataTemplate x:Key="A_DataTemplate_PauseRadio">
        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_TileBackground}">
            <DockPanel>
                <local:FZMaterial DockPanel.Dock="Left"
                                  Style="{StaticResource A_Style_FZMaterial_RadioAlbumArt}" />
                <Grid>
                    <local:FZMaterial
                        Height="69"
                        Width="168"
                        Margin="0,0,0,15"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Top"
                        ImageSource="{Binding CurrentRadioStationName, Converter={StaticResource A_Converter_NowPlayingRadioStationImageSources}}"
                        StretchDirection="Both"
                        Stretch="Uniform"
                        Visibility="{Binding ImageSource, RelativeSource={RelativeSource Self}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                    <DockPanel MaxHeight="70"
                        Margin="{StaticResource A_Thickness_TilePadding_IconTile}"
                        VerticalAlignment="Bottom">
                        <Decorator
                            DockPanel.Dock="Top">
                            <local:AutoScrollPanel Style="{StaticResource A_Style_AutoScrollPanel_RadioArtistTitle}"/>
                        </Decorator>
                        <local:FZTextBlock local:TextBlockInlineMarkup.Markup="{Binding CurrentRadioTrackName}"
                            Style="{StaticResource A_Style_FZTextBlock_TileText_Base}"
                            Color="#DCFFFFFF"
                            FontSize="24"
                            TextWrapping="WrapWithOverflow"
                            Visibility="{Binding CurrentRadioTrackName, Converter={StaticResource A_StringVisConverter}}"
                            Margin="0,8,0,0"
                            LineAdjust="-0.25"
                            />
                    </DockPanel>
                </Grid>
            </DockPanel>
        </local:FZMaterial>
    </DataTemplate>
</ResourceDictionary>
