<Page x:Name="Page"
    x:Class="ForzaUI.A_LiveryLayerSelect"
    xmlns:local="clr-namespace:ForzaUI"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:System="clr-namespace:System;assembly=mscorlib"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    mc:Ignorable="d"
    Style="{StaticResource A_Style_Page_Generic}"
    DataContext="{Binding RelativeSource={RelativeSource Self}}">
    
    <Page.Resources>
        <ResourceDictionary>
            <ColorAlias x:Key="A_Color_LayerNumberText" Color="{StaticResource H_Color_Primary_Black}"/>
            <Color x:Key="H_Color_Toggle_Background">#FF8C8C8C</Color>

            <UIStoryboard x:Key="A_Storyboard_ShowButtonPrompt">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                    <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="1"/>
                </DoubleAnimationUsingKeyFrames>
            </UIStoryboard>

            <UIStoryboard x:Key="A_Storyboard_HideButtonPrompt">
                <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)">
                    <LinearDoubleKeyFrame KeyTime="0:0:0.100" Value="0"/>
                </DoubleAnimationUsingKeyFrames>
            </UIStoryboard>
            
            <MappingConverter x:Key="A_Map_ToggleEnabledToAlignment" Default="Right">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}" Value="Left"/>
            </MappingConverter>

            <MappingConverter x:Key="A_Map_ToggleEnabledToColor" Default="{StaticResource H_Color_Primary_Pink}">
                <MappingConverterEntry Key="{StaticResource A_Boolean_False}" Value="{StaticResource H_Color_Primary_White}"/>
            </MappingConverter>

            <Style x:Key="A_Style_Control_MouseRollover_Outer_All_ToggleButton" BasedOn="{StaticResource A_Style_Control_MouseRollover_Outer_All}"  TargetType="{x:Type Control}">
                <Setter
            Property="Template">
                    <Setter.Value>
                        <ControlTemplate
                    TargetType="Control">
                            <FZMaterial
                        Color="{StaticResource H_Color_Primary_White}">
                                <FZMaterial.Preset>
                                    <FZMaterialPresetRoundtangleStroke
                                CornerRadius="{Binding (DynamicData.Data).MouseRolloverCornerRadius, FallbackValue=1, RelativeSource={RelativeSource TemplatedParent}}"
                                Thickness="3" />
                                </FZMaterial.Preset>
                            </FZMaterial>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>

            <Style x:Key="A_Style_FZMaterial_FlatPanel_IconBackground"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}">
                <Setter Property="Preset" Value="{StaticResource A_FZMaterialPresetRoundtangle_FlatPanel_InnerAll}"/>
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_ShadowBase_Dynamic"
             TargetType="{Type FZMaterial}"
             BasedOn="{StaticResource A_Style_FZMaterial_ShadowBase_Dynamic}">
                <Setter Property="Margin" Value="-15"/>
            </Style>

            <Style x:Key="A_Style_FZMaterial_RaiseFocusItemBackground_Dynamic"
                   BasedOn="{StaticResource A_Style_FZMaterial_RaiseFocusItemBackground}"
                   TargetType="local:FZMaterial">
                <Style.Resources>
                    <CornerRadius x:Key="A_CornerRadius_Dynamic_CarouselTile">0</CornerRadius>
                </Style.Resources>
            </Style>

            <Style x:Key="A_Style_FZMaterial_FlatPanel_IconBackground_VerticalContainer"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground}">
                <Setter Property="Width" Value="27" />
                <Setter Property="Height" Value="27" />
            </Style>

            <Style x:Key="A_Style_FZMaterial_FlatPanel_IconBackground_Clipboard"
                   TargetType="{x:Type local:FZMaterial}"
                   BasedOn="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground}">
                <Setter Property="Width" Value="32" />
                <Setter Property="Height" Value="32" />
            </Style>

            <Style x:Key="A_Style_Hideable_Button_Prompt" TargetType="{x:Type Grid}">
                <Style.Triggers>
                    <DataTrigger Binding="{Binding AdvancedCameraEnabled}" Value="False">
                        <DataTrigger.EnterActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_ShowButtonPrompt}"/>
                        </DataTrigger.EnterActions>
                        <DataTrigger.ExitActions>
                            <BeginStoryboard Storyboard="{StaticResource A_Storyboard_HideButtonPrompt}"/>
                        </DataTrigger.ExitActions>
                    </DataTrigger>
                </Style.Triggers>
            </Style>

            <DataTemplate x:Key="A_DataTemplate_Layer">
                <Grid x:Name="Grid_Container">
                    <Grid RenderTransformOrigin="0.5,0.5" local:ZPanel.ZOffset="0">
                        <Grid Visibility="{Binding IsCreateNew, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}">
                            <local:FZMaterial x:Name="Checkerboard" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Checkerboard.png" Opacity="0.15" Color="Black" Style="{StaticResource A_Style_FZMaterial_FlatPanel_Tile}"/>
                        </Grid>

                        <Grid Visibility="{Binding IsLayer, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <local:FZMaterial x:Name="FzMaterial_LiveryShape"
                                          Margin="14">
                                <local:FZMaterial.Effect>
                                    <local:LinearToSRGBEffect>
                                        <local:LinearToSRGBEffect.Input>
                                            <ImageBrush ImageSource="{Binding LiveryImage}"/>
                                        </local:LinearToSRGBEffect.Input>
                                    </local:LinearToSRGBEffect>
                                </local:FZMaterial.Effect>
                            </local:FZMaterial>

                            <local:FZTextBlock Margin="3,3,0,0" Text="{Binding LayerCount}"
                                                   Color="{StaticResource A_Color_LayerNumberText}"
                                                   CapHeight="9"
                                                   TextWrapping="NoWrap">
                                <local:FZTextBlock.ResizableTextSettings>
                                            <ResizableTextSettings MinimumCapHeight="0"/>
                    		    </local:FZTextBlock.ResizableTextSettings>
			                </local:FZTextBlock>
                            <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom">
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_VerticalContainer}" 
                                                  Visibility="{Binding IsGroup, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                    <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Layer_Grouped_Icon.png"/>
                                </local:FZMaterial>
                                <Decorator Height="2" Visibility="{Binding IsMask, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_VerticalContainer}" 
                                                  Visibility="{Binding IsMask, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                    <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/layer_mask_icon.png" />
                                </local:FZMaterial>
                                <Decorator Height="2" Visibility="{Binding IsLocked, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                                <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_VerticalContainer}" 
                                                  Visibility="{Binding IsLocked, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                    <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Lock.png" />
                                </local:FZMaterial>
                            </StackPanel>

                            <Path x:Name="Path_Selected" HorizontalAlignment="Right" Data="M0,0 l25,0 0,25 z" 
                                  Visibility="{Binding IsMultiSelected, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                                <Path.Fill>
                                    <SolidColorBrush Color="{StaticResource A_Color_Tile_Selected}" />
                                </Path.Fill>
                            </Path>
                        </Grid>
                        <Grid Visibility="{Binding IsCreateNew, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <local:FZMaterial 
                                              ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/new_layer.png"
                                              Color="#ff000000"
                                              Margin="10,10,10,10"                                               
                                              />
                        </Grid>
                    </Grid>
                </Grid>
            </DataTemplate>

            <ControlTemplate x:Key="A_ControlTemplate_ClipboardItem">
                <Grid Height="172" Width="172">
                    <local:FZMaterial HorizontalAlignment="Stretch"
                                      VerticalAlignment="Top"
                                      Color ="{StaticResource H_Color_Primary_Black}"
                                      Margin ="0,-53,0,0"
                                      Height ="48"
                                      Preset="{StaticResource H_Roundtangle_Outer_1px}">
                        <local:FZTextBlock Text="{Loc Livery.IDS_Clipboard}"
                                           Style="{StaticResource A_Style_FZTextBlock_SubHeading}"
                                           Color ="White"
                                           HorizontalAlignment="Center"
                                           VerticalAlignment="Center"
                                           CapHeight="18">
                        </local:FZTextBlock>
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="Colour"
                                      Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                      Preset="{StaticResource H_GlassRoundtangle_1px}" >
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="Checkerboard"
                                      Color ="{StaticResource H_Color_Primary_Black}"
                                      ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Checkerboard.png"
                                      Preset="{StaticResource H_Roundtangle_Outer_1px}"
                                      Opacity="0.4" >
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="Border"
                                      Color ="{StaticResource H_Color_Primary_White}"
                                      Margin ="4,4,4,4"
                                      Opacity="0.2">
                        <FZMaterial.Preset>
                            <FZMaterialPresetRoundtangleStroke Thickness="4"
                                                               CornerRadius="1" />
                        </FZMaterial.Preset>
                    </local:FZMaterial>
                    <local:FZMaterial x:Name="FzMaterial_LiveryShape" Margin="30">
                        <local:FZMaterial.Effect>
                            <local:LinearToSRGBEffect>
                                <local:LinearToSRGBEffect.Input>
                                      <ImageBrush ImageSource="{Binding LiveryImage}"/>
                                </local:LinearToSRGBEffect.Input>
                            </local:LinearToSRGBEffect>
                        </local:FZMaterial.Effect>
                    </local:FZMaterial>
                    <StackPanel HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,12,12">
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_Clipboard}"
                                          Visibility="{Binding IsLocked, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Lock.png" />
                        </local:FZMaterial>
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_Clipboard}"
                                          Visibility="{Binding IsGroup, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/Layer_Grouped_Icon.png" />
                        </local:FZMaterial>
                        <Decorator Height="3" Visibility="{Binding IsMask, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                        <local:FZMaterial Style="{StaticResource A_Style_FZMaterial_FlatPanel_IconBackground_Clipboard}" 
                                          Visibility="{Binding IsMask, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                            <local:FZMaterial Color ="{StaticResource H_Color_Primary_Black}" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/layer_mask_icon.png" />
                        </local:FZMaterial>
                    </StackPanel>
                </Grid>
            </ControlTemplate>

            <Style x:Key="A_Style_FZTextBlock_LayerCount" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_HeaderBlock}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_Green}" />
                <Setter Property="Margin" Value="0" />
                <Setter Property="CapHeight" Value="18"/>
            </Style>

            <Style x:Key="A_Style_FZTextBlock_LayerMaxCount" TargetType="local:FZTextBlock" BasedOn="{StaticResource A_Style_FZTextBlock_LayerCount}">
                <Setter Property="Color" Value="{StaticResource H_Color_Primary_White}" />
            </Style>

            <Style x:Key="H_Style_TabBar_LayerSelect" BasedOn="{StaticResource H_Style_TabBar_SquareIcons}" TargetType="ItemsSelector">
                <Setter Property="Height" Value="48" />
                <Setter Property="SelectedIndex" Value="-1" />
                <Setter Property="Margin" Value="0,0,0,9" />
                <Setter Property="ItemContainerStyle">
                    <Setter.Value>
                        <Style TargetType="FZButton" BasedOn="{StaticResource H_Style_TabButton_SquareIcons}">
                            <Setter Property="Content" Value="{Binding Data.IconPath}"/>
                            <Setter Property="BindingProxy.A" Value="{Binding Data.Title}"/>
                        </Style>
                    </Setter.Value>
                </Setter>
                <Setter Property="DynamicData.Data">
                    <Setter.Value>
                        <DynamicDataSource>
                            <DynamicDataItem
                                Name="TabHeight"
                                DataType="Double"
                                Value="46" />
                            <DynamicDataItem
                                Name="NextOrPreviousWidth"
                                DataType="Double"
                                Value="76" />
                            <DynamicDataItem
                                Name="NextOrPreviousHeight"
                                DataType="Double"
                                Value="46" />
                            <DynamicDataItem
                                Name="ButtonWidth"
                                DataType="Double"
                                Value="96" />
                            <DynamicDataItem
                                Name="IconWidth"
                                DataType="Double"
                                Value="75" />
                            <DynamicDataItem
                                Name="IconHeight"
                                DataType="Double"
                                Value="34" />
                            <DynamicDataItem
                                Name="IconColor"
                                DataType="Color"
                                Value="{StaticResource H_Color_Primary_Black}" />
                        </DynamicDataSource>
                    </Setter.Value>
                </Setter>
            </Style>

        </ResourceDictionary>
    </Page.Resources>

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

    <Grid>
        <PageInputHandler x:Name="details_toggle_more_options" Command="{Binding ToggleMoreOptionsCommand}" Button="L3" />
        <local:RoutedEventCommand x:Name="ToggleMoreOptionsRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding ToggleMoreOptionsCommand, RelativeSource={RelativeSource AncestorType=Page}}" />
        <local:RoutedEventCommand x:Name="ClearMultiSelectStateRoutedEventCommandUp"
                                  RoutedEvent="UIElement.MouseLeftButtonUp"
                                  Command="{Binding ClearMultiSelectState, RelativeSource={RelativeSource AncestorType=Page}}" />
        <local:RoutedEventCommand x:Name="ClearMultiSelectStateRoutedEventCommandLeave"
                                  RoutedEvent="UIElement.MouseLeave"
                                  Command="{Binding ClearMultiSelectState, RelativeSource={RelativeSource AncestorType=Page}}" />
        <local:RoutedEventCommand x:Name="StartMultiSelectRoutedEventCommand"
                                  RoutedEvent="UIElement.MouseLeftButtonDown"
                                  Command="{Binding StartMultiSelect, RelativeSource={RelativeSource AncestorType=Page}}" />
        <local:FZMaterialGlassCapture />

        <ContentControl Style="{StaticResource A_Style_ButtonBar}"
                        x:Name="BottomBar">
            <local:ControllerButtonPanel x:Name="PART_HelpPanel"
                                         Style="{StaticResource A_Style_ControllerButtonPanel_Default}">
                <local:ControllerButtonControl Button="A"
                                               Description="{local:Loc HelpButtons.IDS_OK}" />
                <local:ControllerButtonControl Button="B"
                                               Description="{local:Loc HelpButtons.IDS_Back}" />
                <local:ControllerButtonControl Button="X"
                                               Description="{local:Loc HelpButtons.IDS_Cut}" 
                                               Visibility="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"/>
                <local:ControllerButtonControl Button="X"
                                               Description="{local:Loc HelpButtons.IDS_Copy}" 
                                               Visibility="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <local:ControllerButtonControl Button="Y"
                                               Description="{local:Loc HelpButtons.IDS_Insert}" 
                                               Visibility="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}"/>
                <local:ControllerButtonControl Button="Y"
                                               Description="{local:Loc HelpButtons.IDS_Paste}" 
                                               Visibility="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"/>
                <local:ControllerButtonControl Button="R3"
                                               Description="{local:Loc HelpButtons.IDS_ToggleBackground}"
                                               Visibility="{Binding IsMultiSection, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}}" />
                <local:ControllerButtonControl Button="RTrigger"
                                               Description="{local:Loc HelpButtons.IDS_ToggleLayerSel}"
                                               local:RoutedEventCommand.Action3="{Binding ElementName=StartMultiSelectRoutedEventCommand}"
                                               local:RoutedEventCommand.Action="{Binding ElementName=ClearMultiSelectStateRoutedEventCommandUp}"
                                               local:RoutedEventCommand.Action2="{Binding ElementName=ClearMultiSelectStateRoutedEventCommandLeave}" />
                <local:ControllerButtonControl Button="Back"
                                               Description="{local:Loc HelpButtons.IDS_Save}" />
                <local:ControllerButtonControl Button="DPadHorizontal"
                                               Description="{local:Loc HelpButtons.IDS_Skip}"
                                               Visibility="{Binding IsControllerActiveInput, RelativeSource={RelativeSource AncestorType=Page}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
            </local:ControllerButtonPanel>
        </ContentControl>

        <Border x:Name="PART_LayoutRoot" Style="{StaticResource A_Style_Border_ScenePadding_Opus_BottomAnchor}" Padding="72,48">
            <DockPanel>
            <StackPanel Orientation="Vertical"
                            DockPanel.Dock="Left"
                        x:Name="LiveryStack">
                <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" MaxWidth="1403"/>
                        <ColumnDefinition Width="14"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <Grid x:Name="PART_CategoryRibbon" VerticalAlignment="Bottom" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}"
                        Visibility="{Binding IsMultiSection, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <FZButtonsSelector
                                x:Name="PART_LayerSectionList"
                                MaxWidth="1250"
                                Style="{StaticResource H_Style_TabBar_LayerSelect}"
                                ItemsSource="{Binding MenuItems}"
                                SelectedItem="{Binding SelectedView, Mode=TwoWay}"
                                local:RoutedEventCommand.Action="{Binding ElementName=ButtonBarDisableMouseCursorMovement}"
                                local:RoutedEventCommand.Action2="{Binding ElementName=ButtonBarEnableMouseCursorMovement}"/>
                    </Grid>
                </Grid>

            <Grid Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_2}" 
            KeyboardNavigation.DirectionalNavigation="Contained"
            HorizontalAlignment="Left">
                    <DockPanel>
                        <local:FZMaterial x:Name="Background"
                                            Style="{StaticResource H_Style_Container_GlassHighBlur_Description}"
                                            Width="{StaticResource A_Double_Carousel_Vertical_Item_Tile_Width}"
                                            Preset="{StaticResource H_Roundtangle_Outer_1px}" 
                                            DockPanel.Dock="Left">
                            <local:WrapListBox x:Name="PART_LayerItemList"
                               Focusable="False"
                               Style="{StaticResource A_Style_Carousel_Square_Vertical_Item}"
                               ItemTemplate="{StaticResource A_DataTemplate_Layer}"
                               SelectedIndex="0"
                               ItemsSource="{Binding SelectedItem, ElementName=PART_LayerSectionList}"
                               SelectedItem="{Binding SelectedItem.Data.SelectedItem, ElementName=PART_LayerSectionList, Mode=TwoWay}"
                               local:RoutedEventCommand.Action="{Binding ElementName=ButtonBarDisableMouseCursorMovement}"
                               local:RoutedEventCommand.Action2="{Binding ElementName=ButtonBarEnableMouseCursorMovement}"/>
                        </local:FZMaterial>
                        <ScrollBar
                               Style="{StaticResource H_Style_ScrollBar}"
                               Margin = "8,0,0,0"
                               Minimum="{Binding ScrollWindowMin, ElementName=PART_LayerItemList}"
                               Maximum="{Binding ScrollWindowMax, ElementName=PART_LayerItemList}"
                               Value="{Binding ScrollWindowValue, ElementName=PART_LayerItemList, Mode=TwoWay}"
                               ViewportSize="{Binding ScrollWindowSize, ElementName=PART_LayerItemList}"
                               DockPanel.Dock="Right">
                            <DynamicData.Data>
                                <DynamicDataItem
                                           Name="ScrollBarHideWhenNotNeeded"
                                           DataType="Boolean"
                                           Value="True" />
                            </DynamicData.Data>
                        </ScrollBar>
                    </DockPanel>
                </Grid>

                    <StackPanel Orientation="Horizontal" Margin="0,10,1356,0" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                        <DockPanel
                  MinWidth="155"
                           Height="48" 
                  Margin="0,0,8,0"
                  LastChildFill="True">
                    <local:FZMaterial x:Name="Icon"
                                      Width="48" Height="48"
                                      DockPanel.Dock="Left"
                                      VerticalAlignment="Center"
                                      local:BindingProxy.B="{Binding (local:BindingProxy.B), RelativeSource={RelativeSource TemplatedParent}}"
                                      Color="{StaticResource H_Color_Primary_White}"
                                      Preset="{StaticResource H_Roundtangle_LeftOnly_1px}">
                        <local:FZMaterial ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/layer_icon.png"
                                          Width="23" Height="23" Color ="{StaticResource H_Color_Primary_Black}"/>
                    </local:FZMaterial>
                            <local:FZMaterial x:Name="FZ_Material_Background"  HorizontalAlignment="Left" Color="{StaticResource H_Color_Glass_Purple_40pc}" Preset="{StaticResource A_FZMaterialPresetGlass_High}">
                                <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center" Margin="12,0,12,0">
                            <local:FZTextBlock Text="{Binding CurrentLayerCount}" Style="{StaticResource A_Style_FZTextBlock_LayerCount}" />
                            <local:FZTextBlock Text="/" Style="{StaticResource A_Style_FZTextBlock_LayerMaxCount}" Margin="4,0,4,0" />
                            <local:FZTextBlock Text="{Binding MaxLayerCount}" Style="{StaticResource A_Style_FZTextBlock_LayerMaxCount}" />
                        </StackPanel>
                    </local:FZMaterial>
                </DockPanel>

                        <Grid Name="More_Options_Button_Prompt"
                              HorizontalAlignment="Left" 
                              VerticalAlignment="Bottom" 
                              MinWidth="250" 
                              Height="48"
                              Style="{StaticResource A_Style_Hideable_Button_Prompt}"
                              local:RoutedEventCommand.Action="{Binding ElementName=ToggleMoreOptionsRoutedEventCommand}">
                            <FZMaterial 
                                 Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                 Preset="{StaticResource H_GlassRoundtangle_1px}"/>
                            <StackPanel Margin="10,0,10,0" Orientation="Horizontal">
                                <ControllerButtonControl
                                     Button="{Binding Button, ElementName=details_toggle_more_options}"
                                     Description="{local:Loc HelpButtons.IDS_MoreOptions}"
                                     HideBackground="True"/>
                                <Decorator Width="22" Visibility="{Binding IsControllerActiveInput, Converter={StaticResource A_FZBooleanToVisibilityConverter_Inverse}, RelativeSource={RelativeSource AncestorType=Page}}"/>
                                <Grid Margin="-20,0,0,0">
                                    <FZMaterial
                                         Height="28"
                                         Width="41"
                                         Color="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangleStroke CornerRadius="14" Thickness="2.5" />
                                        </FZMaterial.Preset>
                                    </FZMaterial>
                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <FZMaterial
                                             Height="17"
                                             Width="30"
                                             Color="{StaticResource H_Color_Toggle_Background}">
                                            <FZMaterial.Preset>
                                                <FZMaterialPresetRoundtangle CornerRadius="8" />
                                            </FZMaterial.Preset>
                                        </FZMaterial>
                                        <FZMaterial
                                             Height="18"
                                             Width="18"
                                             Color="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}"
                                             HorizontalAlignment="{Binding IsMoreOptionsEnabled, Converter={StaticResource A_Map_ToggleEnabledToAlignment},RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                                            <FZMaterial.Preset>
                                                <FZMaterialPresetRoundtangle CornerRadius="8" />
                                            </FZMaterial.Preset>
                                        </FZMaterial>
                                    </Grid>
                                </Grid>

                            </StackPanel>

                            <FZMaterial Color="#0fff" IsHitTestVisible="True" />

                            <Control Style="{StaticResource A_Style_Control_MouseRollover_Outer_All_ToggleButton}"
                                 Visibility="{Binding IsMouseOver,  RelativeSource={RelativeSource FindAncestor, AncestorType=Grid}, Converter={StaticResource A_FZBooleanToVisibilityConverter}}" />
                        </Grid>
                    </StackPanel>

                    <Grid x:Name="Grid_Clipboard"
                            Margin="0,-168,-6,0"
                            DataContext="{Binding LiveryClipboard}"
                            Visibility="{Binding IsVisible, Converter={StaticResource A_FZBooleanToVisibilityConverter}}"
                            HorizontalAlignment="Right" 
                            Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                        <Control x:Name="ClipboardElement" Template="{StaticResource A_ControlTemplate_ClipboardItem}"/>
                    </Grid>
                </StackPanel>
                <StackPanel Margin="0,1,0,0" Visibility="{Binding IsControllerActiveInput, Converter={StaticResource A_FZBooleanToVisibilityConverter}, RelativeSource={RelativeSource AncestorType=Page}}" Style="{StaticResource A_Style_FrameworkElement_DefaultTransition_1}">
                    <StackPanel Orientation="Horizontal"  HorizontalAlignment="Right"  Visibility="{Binding HasCamera, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <FZMaterial Color="{StaticResource H_Color_Primary_White}" Height="48" Width="48">
                            <FZMaterial Color="{StaticResource H_Color_Primary_Black}"  Height="48" Width="48" ImageSource="/ForzaUI;component/Textures/Anthem/Paintshop/advanced_camera.png"/>
                        </FZMaterial>
                        <Grid 
                            Name="Advanced_Camera_Button_Prompt"
                            MinWidth="300" 
                            Height="48">
                            <FZMaterial 
                                Color="{StaticResource H_Color_Glass_Purple_40pc}"
                                Preset="{StaticResource H_GlassRoundtangle_1px}"/>
                            <DockPanel Margin="10,0,10,0">
                                <ControllerButtonControl
                                Button="LTrigger"
                                Description="{local:Loc HelpButtons.IDS_AdvancedCamera}"
                                HideBackground="True"/>
                                <Grid>
                                    <FZMaterial
                                    Height="30"
                                    Width="43"
                                    Color="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}">
                                        <FZMaterial.Preset>
                                            <FZMaterialPresetRoundtangleStroke CornerRadius="14" Thickness="3.5" />
                                        </FZMaterial.Preset>
                                    </FZMaterial>
                                    <Grid HorizontalAlignment="Center" VerticalAlignment="Center">
                                        <FZMaterial
                                            Height="17"
                                            Width="30"
                                            Color="{StaticResource H_Color_Toggle_Background}">
                                            <FZMaterial.Preset>
                                                <FZMaterialPresetRoundtangle CornerRadius="8" />
                                            </FZMaterial.Preset>
                                        </FZMaterial>
                                        <FZMaterial
                                           Height="18"
                                           Width="18"
                                           Color="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToColor}}"
                                           HorizontalAlignment="{Binding AdvancedCameraEnabled, Converter={StaticResource A_Map_ToggleEnabledToAlignment},RelativeSource={RelativeSource FindAncestor, AncestorType=Page}}">
                                            <FZMaterial.Preset>
                                                <FZMaterialPresetRoundtangle CornerRadius="8" />
                                            </FZMaterial.Preset>
                                        </FZMaterial>
                                    </Grid>
                                </Grid>
                            </DockPanel>
                            <FZMaterial Color="#0fff" IsHitTestVisible="True" />
                        </Grid>
                    </StackPanel>
                    <FZMaterial Color="{StaticResource H_Color_Glass_Purple_20pc}" 
                                Preset="{StaticResource H_GlassRoundtangle_1px}" 
                                Height="48" 
                                Width="219" 
                                HorizontalAlignment="Right"
                                Margin="0,3,0,0"
                                Visibility="{Binding AdvancedCameraEnabled, Converter={StaticResource A_FZBooleanToVisibilityConverter}}">
                        <StackPanel Orientation="Horizontal">
                            <ControllerButtonControl
                               Margin="10,0,0,0"
                               Button="LThumb_UpDown"
                               Description="{local:Loc HelpButtons.IDS_AdvancedCameraZoom}"
                               HorizontalAlignment="Left"
                               HideBackground="True"/>
                            <ControllerButtonControl
                               Button="RThumb" 
                               HorizontalAlignment="Right"
                               Description="{local:Loc HelpButtons.IDS_AdvancedCameraPan}"
                               HideBackground="True"/>
                        </StackPanel>
                    </FZMaterial>
                </StackPanel>
             </DockPanel>
        </Border>
    </Grid>
</Page>
