<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon">

    <Style x:Key="Menu.MenuBar.PinnedIcon.Base"
           TargetType="ico:AdaptableIcon">
        <Setter Property="Margin"
                Value="5, 0, 5, 0" />
        <Setter Property="IconBackgroundColor"
                Value="Transparent" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="IconHeight"
                Value="30" />
        <Setter Property="IconWidth"
                Value="30" />
        <Setter Property="BorderPadding"
                Value="5" />
        <Setter Property="PrimaryIconColor"
                Value="{DynamicResource Color.Menu.Icon}" />
    </Style>

    <Style x:Key="Menu.MenuBar.PinnedIcon"
           TargetType="ico:AdaptableIcon"
           BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Base}">
        <Setter Property="Cursor"
                Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True"> 
                <!--new Margin:                 
                        Old Margin - (New Width - Old Width) / 2
                        Old Margin - (New Height - Old Height)
                        Old Margin - (New Width - Old Width) / 2
                        Old Margin - (New Height - Old Height)          -->               
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="IconBackgroundColor"
                        Value="{DynamicResource Background.Menu.Icon.Hover}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.MenuBar.PinnedIcon.Color"
       TargetType="ico:AdaptableIcon"
       BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Base}">
        <Setter Property="Cursor"
            Value="Hand" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                 Value="True">
                <Setter Property="PrimaryIconColor"
                    Value="{DynamicResource Color.Menu.Icon.Hover}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.MenuBar.PinnedIcon.Pinned"
           TargetType="ico:AdaptableIcon"
           BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Base}">
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="HorizontalAlignment"
                Value="Center" />
        <Setter Property="IconHeight"
                        Value="36" />
        <Setter Property="IconWidth"
                        Value="36" />
        <Setter Property="Margin"
                        Value="2, -3, 2, -3" />
        <Setter Property="BorderPadding"
                        Value="7.5" />
        <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon}" />
        <Setter Property="IconBackgroundColor"
                        Value="{DynamicResource Background.Menu.Icon.Hover}" />
        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.MenuBar.PinnedIcon.Disabled"
           TargetType="ico:AdaptableIcon"
           BasedOn="{StaticResource Menu.MenuBar.PinnedIcon.Base}">

        <Setter Property="Opacity"
            Value="0.45" />
    </Style>

    <Style x:Key="Menu.MenuBar.PinnedIcon.More"
           TargetType="ico:AdaptableIcon"
           BasedOn="{StaticResource Menu.MenuBar.PinnedIcon}">
        <Setter Property="SelectedMaterialIcon"
                Value="ic_menu" />
        <Setter Property="BorderPadding"
                Value="1.5" />

        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="IconHeight"
                        Value="36" />
                <Setter Property="IconWidth"
                        Value="36" />
                <!--new Margin:                 
                        Old Margin - (New Width - Old Width) / 2
                        Old Margin - (New Height - Old Height)
                        Old Margin - (New Width - Old Width) / 2
                        Old Margin - (New Height - Old Height)          -->
                <Setter Property="Margin"
                        Value="2, -3, 2, -3" />
                <Setter Property="BorderPadding"
                        Value="4" />
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="IconBackgroundColor"
                        Value="{DynamicResource Background.Menu.Icon.Hover}" />
            </Trigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.Selector.Icon.Lock"
           TargetType="ico:AdaptableIcon">
        <Setter Property="SelectedInternIcon"
                Value="lock_open" />
        <Setter Property="PrimaryIconColor"
                Value="{DynamicResource Color.SoftContrast}" />
        <Setter Property="BorderPadding"
                Value="5.5" />
        <Setter Property="IconHeight"
                Value="35" />
        <Setter Property="IconWidth"
                Value="20" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Style.Triggers>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=QuickActionSelectorUc, Path=IsLocked}"
                               Value="False" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                               Value="False" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                        Value="lock_open" />
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.SoftContrast}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=QuickActionSelectorUc, Path=IsLocked}"
                               Value="False" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                               Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                        Value="lock_openHover" />
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=QuickActionSelectorUc, Path=IsLocked}"
                               Value="True" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                               Value="False" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                        Value="lock_closed" />
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=QuickActionSelectorUc, Path=IsLocked}"
                               Value="True" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                               Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                        Value="lock_closedHover" />
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="BorderPadding"
                        Value="3" />
            </MultiDataTrigger>

        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.Notepad.Icon.Lock"
       TargetType="ico:AdaptableIcon">
        <Setter Property="SelectedInternIcon"
            Value="lock_open" />
        <Setter Property="PrimaryIconColor"
            Value="{DynamicResource Color.SoftContrast}" />
        <Setter Property="BorderPadding"
            Value="5.5" />
        <Setter Property="IconHeight"
            Value="35" />
        <Setter Property="IconWidth"
            Value="20" />
        <Setter Property="Cursor"
            Value="Hand" />
        <Style.Triggers>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=NotepadUc, Path=IsLocked}"
                           Value="False" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                           Value="False" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                    Value="lock_open" />
                <Setter Property="PrimaryIconColor"
                    Value="{DynamicResource Color.SoftContrast}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=NotepadUc, Path=IsLocked}"
                           Value="False" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                           Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                    Value="lock_openHover" />
                <Setter Property="PrimaryIconColor"
                    Value="{DynamicResource Color.Menu.Icon.Hover}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=NotepadUc, Path=IsLocked}"
                           Value="True" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                           Value="False" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                    Value="lock_closed" />
                <Setter Property="PrimaryIconColor"
                    Value="{DynamicResource Color.Menu.Icon}" />
            </MultiDataTrigger>

            <MultiDataTrigger>
                <MultiDataTrigger.Conditions>
                    <Condition Binding="{Binding ElementName=NotepadUc, Path=IsLocked}"
                           Value="True" />
                    <Condition Binding="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}"
                           Value="True" />
                </MultiDataTrigger.Conditions>

                <Setter Property="SelectedInternIcon"
                    Value="lock_closedHover" />
                <Setter Property="PrimaryIconColor"
                    Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="BorderPadding"
                    Value="3" />
            </MultiDataTrigger>

        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.CategoryBase"
           TargetType="Border">
        <Setter Property="Margin"
                Value="0, 0.5, 0, 0.5" />
        <Setter Property="Padding"
                Value="10, 0, 10, 0" />
        <Setter Property="Cursor"
                Value="Hand" />
        <Setter Property="BorderThickness"
                Value="0, 0.5, 0, 0.5" />
        <Setter Property="BorderBrush"
                Value="{DynamicResource BackgroundColor.Menu.Categories}" />
    </Style>

    <Style x:Key="Menu.CategoryBase.TextBlock.NoHover"
           TargetType="TextBlock">
        <Setter Property="Foreground"
                Value="{DynamicResource FontColor.Menu.Categories}" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
    </Style>

    <Style x:Key="Menu.CategoryBase.TextBlock"
           TargetType="TextBlock"
           BasedOn="{StaticResource Menu.CategoryBase.TextBlock.NoHover}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Border}, Path=IsMouseOver}"
                         Value="True">
                <Setter Property="Foreground"
                        Value="{DynamicResource FontColor.Menu.Categories.Hover}" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.CategoryBase.Icon.NoHover"
           TargetType="ico:AdaptableIcon">
        <Setter Property="PrimaryIconColor"
                Value="{DynamicResource Color.Menu.Icon}" />
        <Setter Property="IconHeight"
                Value="20" />
        <Setter Property="IconWidth"
                Value="20" />
        <Setter Property="BorderPadding"
                Value="1.5" />
    </Style>

    <Style x:Key="Menu.CategoryBase.Icon"
           TargetType="ico:AdaptableIcon"
           BasedOn="{StaticResource Menu.CategoryBase.Icon.NoHover}">
        <Style.Triggers>
            <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorLevel=1, AncestorType=Border}, Path=IsMouseOver}"
                         Value="True">
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="BorderPadding"
                        Value="0" />
            </DataTrigger>
        </Style.Triggers>
    </Style>

    <Style x:Key="Menu.MainCategory.NoHover"
           TargetType="Border"
           BasedOn="{StaticResource Menu.CategoryBase}">

        <Setter Property="Height"
                Value="45" />
        <Setter Property="Background"
                Value="{DynamicResource BackgroundColor.Menu.MainCategory}" />
        <Setter Property="Cursor"
                Value="{x:Null}" />

        <Style.Resources>
            <Style TargetType="TextBlock"
                   BasedOn="{StaticResource Menu.CategoryBase.TextBlock.NoHover}" />
            <Style TargetType="ico:AdaptableIcon"
                   BasedOn="{StaticResource Menu.CategoryBase.Icon.NoHover}" />

        </Style.Resources>
    </Style>

    <Style x:Key="Menu.MainCategory"
           TargetType="Border"
           BasedOn="{StaticResource Menu.CategoryBase}">

        <Setter Property="Height"
                Value="45" />
        <Setter Property="Background"
                Value="{DynamicResource BackgroundColor.Menu.MainCategory}" />

        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="Background"
                        Value="{DynamicResource BackgroundColor.Menu.MainCategory.Hover}" />
            </Trigger>
        </Style.Triggers>

        <Style.Resources>
            <Style TargetType="TextBlock"
                   BasedOn="{StaticResource Menu.CategoryBase.TextBlock}" />
            <Style TargetType="ico:AdaptableIcon"
                   BasedOn="{StaticResource Menu.CategoryBase.Icon}" />
        </Style.Resources>
    </Style>

    <Style x:Key="Menu.MainCategory.Hover"
           TargetType="Border"
           BasedOn="{StaticResource Menu.MainCategory}">
        <Setter Property="Background"
                Value="{DynamicResource BackgroundColor.Menu.MainCategory.Hover}" />

        <Style.Resources>
            <Style TargetType="TextBlock"
                   BasedOn="{StaticResource Menu.CategoryBase.TextBlock}">
                <!--<Setter Property="Margin"
                        Value="15, 0, 0, 0" />-->
                <Setter Property="Foreground"
                        Value="{DynamicResource FontColor.Menu.Categories.Hover}" />
            </Style>

            <Style TargetType="ico:AdaptableIcon"
                   BasedOn="{StaticResource Menu.CategoryBase.Icon}">
                <Setter Property="PrimaryIconColor"
                        Value="{DynamicResource Color.Menu.Icon.Hover}" />
                <Setter Property="BorderPadding"
                        Value="0" />
            </Style>
        </Style.Resources>
    </Style>

    <Style x:Key="Menu.SubCategory"
           TargetType="Border"
           BasedOn="{StaticResource Menu.CategoryBase}">

        <Setter Property="Height"
                Value="45" />
        <Setter Property="Background"
                Value="{DynamicResource BackgroundColor.Menu.SubCategory}" />

        <Style.Triggers>
            <Trigger Property="IsMouseOver"
                     Value="True">
                <Setter Property="Background"
                        Value="{DynamicResource BackgroundColor.Menu.SubCategory.Hover}" />
            </Trigger>
        </Style.Triggers>

        <Style.Resources>
            <Style TargetType="TextBlock"
                   BasedOn="{StaticResource Menu.CategoryBase.TextBlock}" />
            <Style TargetType="ico:AdaptableIcon"
                   BasedOn="{StaticResource Menu.CategoryBase.Icon}" />
        </Style.Resources>
    </Style>

    <Style x:Key="Menu.DropShadow">
        <Setter Property="Control.Effect">
            <Setter.Value>
                <DropShadowEffect BlurRadius="10"
                                  Color="{DynamicResource DropShadowColor.Menu}"
                                  Direction="55"
                                  ShadowDepth="10"
                                  Opacity="0.6" />
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>