<UserControl x:Class="FasdDesktopUi.Basics.UserControls.QuickActionSelector"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:local="clr-namespace:FasdDesktopUi.Basics.UserControls"
             xmlns:ico="clr-namespace:FasdDesktopUi.Basics.UserControls.AdaptableIcon;assembly=F4SD-AdaptableIcon"
             xmlns:converter="clr-namespace:FasdDesktopUi.Basics.Converter"
             Name="QuickActionSelectorUc"
             Visibility="Collapsed"
             IsVisibleChanged="BlurInvoker_IsActiveChanged"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800">

    <UserControl.Resources>
        <converter:NullValueToVisibilityConverter x:Key="NullToVisibility" />
    </UserControl.Resources>

    <Border Padding="10"
            CornerRadius="10"
            Background="{DynamicResource BackgroundColor.Menu.Categories}">

        <DockPanel>

            <DockPanel DockPanel.Dock="Top">

                <ico:AdaptableIcon x:Name="CloseButton"
                                   DockPanel.Dock="Right"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   MouseUp="CloseButton_MouseUp"
                                   TouchDown="CloseButton_TouchDown"
                                   SelectedInternIcon="window_close" />

                <ico:AdaptableIcon x:Name="LockButton"
                                   DockPanel.Dock="Right"
                                   Style="{DynamicResource Menu.Selector.Icon.Lock}"
                                   MouseUp="LockButton_MouseUp"
                                   TouchDown="LockButton_TouchDown"
                                   MouseLeave="LockButton_MouseLeave"/>

                <ico:AdaptableIcon x:Name="BackButton"
                                   DockPanel.Dock="Left"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   Margin="-10 0 5 0"
                                   BorderPadding="5"
                                   MouseLeftButtonUp="BackButton_MouseLeftButtonUp"
                                   TouchDown="BackButton_TouchDown"
                                   HorizontalAlignment="Left"
                                   SelectedMaterialIcon="ic_subdirectory_arrow_right"
                                   Visibility="{Binding ElementName=QuickActionSelectorUc, Path=TempQuickActionList, Converter={StaticResource NullToVisibility}, UpdateSourceTrigger=PropertyChanged}">
                    <ico:AdaptableIcon.LayoutTransform>
                        <RotateTransform CenterX="0.5"
                                         CenterY="0.5"
                                         Angle="180" />
                    </ico:AdaptableIcon.LayoutTransform>
                </ico:AdaptableIcon>

                <ico:AdaptableIcon x:Name="SelectorTypeIcon"
                                   DockPanel.Dock="Left"
                                   VerticalAlignment="Center"
                                   PrimaryIconColor="{DynamicResource Color.FunctionMarker}"
                                   BorderPadding="0"
                                   IconHeight="15"
                                   IconWidth="15"
                                   SelectedInternIcon="misc_functionBolt" />

                <TextBlock Text="{Binding ElementName=QuickActionSelectorUc, Path=QuickActionSelectorHeading}"
                           DockPanel.Dock="Left"
                           Style="{DynamicResource DetailsPage.DataHistory.TitleColumn.OverviewTitle}"
                           VerticalAlignment="Center"
                           HorizontalAlignment="Left"
                           Margin="10" />

            </DockPanel>

            <local:CustomMenu x:Name="SubMenuUc"
                              DockPanel.Dock="Top"
                              MenuDataList="{Binding ElementName=QuickActionSelectorUc, Path=QuickActionList}" />

        </DockPanel>

    </Border>

</UserControl>
