<UserControl x:Class="FasdDesktopUi.Basics.UserControls.QuickActionStatusMonitor"
             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:gif="http://wpfanimatedgif.codeplex.com"
             xmlns:converter="clr-namespace:FasdDesktopUi.Basics.Converter"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800"
             x:Name="QuickActionStatusMonitorUc"
             IsVisibleChanged="BlurInvoker_IsActiveChanged">

    <UserControl.Resources>
        <converter:NullValueToVisibilityConverter x:Key="NullToVisibility" />
        <converter:LanguageDefinitionsConverter x:Key="LanguageConverter" />
        <BooleanToVisibilityConverter x:Key="BoolToVisibility" />
    </UserControl.Resources>

    <Border Visibility="{Binding ElementName=QuickActionStatusMonitorUc, Path=QuickActionData, Converter={StaticResource NullToVisibility}}"
            CornerRadius="10"
            Padding="10"
            Margin="0 0 0 10"
            Background="{DynamicResource BackgroundColor.DetailsPage.DataHistory.ValueColumn}">

        <StackPanel>
            <DockPanel LastChildFill="False">

                <ico:AdaptableIcon x:Name="CloseButton"
                                   DockPanel.Dock="Right"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   MouseUp="CloseButton_MouseUp"
                                   TouchDown="CloseButton_TouchDown"
                                   Visibility="{Binding ElementName=QuickActionStatusMonitorUc, Path=IsCloseButtonVisible, Converter={StaticResource BoolToVisibility}}"
                                   SelectedInternIcon="window_close" />

                <ico:AdaptableIcon x:Name="ExecuteButton"
                                   DockPanel.Dock="Left"
                                   VerticalAlignment="Center"
                                   BorderPadding="2.5"
                                   IconHeight="15"
                                   IconWidth="15"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   MouseUp="ExecuteButton_MouseUp"
                                   TouchDown="ExecuteButton_TouchDown"
                                   SelectedInternIcon="misc_play" />

                <ico:AdaptableIcon DockPanel.Dock="Left"
                                   Style="{DynamicResource Menu.MenuBar.PinnedIcon.Base}"
                                   ToolTip="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickAction.Permission.User}"
                                   VerticalAlignment="Center"
                                   Margin="7.5 0 0 0"
                                   BorderPadding="0"
                                   IconHeight="15"
                                   IconWidth="15"
                                   Visibility="{Binding ElementName=QuickActionStatusMonitorUc, Path=QuickActionData.RequiresUserPermission, Converter={StaticResource BoolToVisibility}}"
                                   SelectedInternIcon="misc_user" />

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

                <ico:AdaptableIcon x:Name="CopyButton"
                                   Visibility="Collapsed"
                                   DockPanel.Dock="Left"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   VerticalAlignment="Center"
                                   BorderPadding="0"
                                   IconHeight="15"
                                   IconWidth="15"
                                   MouseLeftButtonUp="CopyButton_MouseLeftButtonUp"
                                   TouchDown="CopyButton_TouchDown"
                                   SelectedInternIcon="menuBar_copy" />

                <ico:AdaptableIcon x:Name="SecretButton"
                                   Visibility="Collapsed"
                                   DockPanel.Dock="Left"
                                   Style="{DynamicResource SettingsPage.Close.Icon}"
                                   Margin="5 0 0 0"
                                   VerticalAlignment="Center"
                                   BorderPadding="0"
                                   IconHeight="15"
                                   IconWidth="15"
                                   MouseLeftButtonUp="SecretButton_MouseLeftButtonUp"
                                   TouchDown="SecretButton_TouchDown"
                                   SelectedMaterialIcon="ic_visibility" />
            </DockPanel>

            <Border Padding="7.5"
                    Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
                    CornerRadius="10">
                <DockPanel x:Name="CompletionStatusPanel">
                    <DockPanel.Resources>
                        <Style TargetType="TextBlock"
                               BasedOn="{StaticResource DetailsPage.DataHistory.Value}">
                            <Setter Property="FontWeight"
                                    Value="Regular" />
                            <Setter Property="Foreground"
                                    Value="{DynamicResource FontColor.DetailsPage.DataHistory.Value}" />
                            <Setter Property="TextAlignment"
                                    Value="Left" />
                            <Setter Property="TextWrapping"
                                    Value="Wrap" />
                        </Style>

                        <Style TargetType="ico:AdaptableIcon"
                               BasedOn="{StaticResource SlimPage.Widget.Header.Icon}">
                            <Setter Property="Margin"
                                    Value="7.5 2.5" />
                        </Style>

                    </DockPanel.Resources>
                </DockPanel>
            </Border>

            <StackPanel x:Name="QuickActionResultStack" />

            <Border Padding="7.5"
                    CornerRadius="10"
                    Margin="0 7.5 0 0"
                    Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
                    Visibility="{Binding ElementName=QuickActionStatusMonitorUc, Path=MeasureValues, Converter={StaticResource NullToVisibility}}">
                <Grid x:Name="MeasureValueGrid" />
            </Border>

            <local:AdjustableParameterSection x:Name="AdjustableParameterSectionUc"
                                              Margin="0 7.5 0 0"
                                              AdjustableParameters="{Binding ElementName=QuickActionStatusMonitorUc, Path=QuickActionData.QuickActionParameters}"
                                              Visibility="{Binding ElementName=QuickActionStatusMonitorUc, Path=QuickActionData.QuickActionParameters, Converter={StaticResource NullToVisibility}}" />

        </StackPanel>

    </Border>
</UserControl>
