<UserControl x:Class="FasdDesktopUi.Basics.UserControls.QuickActionStatusMonitorResultElement"
             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:vc="clr-namespace:FasdDesktopUi.Basics.Converter"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800">

    <UserControl.Resources>
        <vc:LanguageDefinitionsConverter x:Key="LanguageConverter" />
        <Style TargetType="TextBlock"
               BasedOn="{StaticResource DetailsPage.DataHistory.Value}">
            <Setter Property="FontWeight"
                    Value="Bold" />
            <Setter Property="Foreground"
                    Value="{DynamicResource FontColor.DetailsPage.DataHistory.Value}" />
            <Setter Property="TextAlignment"
                    Value="Left" />
            <Setter Property="TextWrapping"
                    Value="Wrap" />

            <Style.Triggers>
                <EventTrigger RoutedEvent="Control.MouseLeftButtonUp">
                    <EventTrigger.Actions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation From="0.4"
                                                 Duration="0:0:1"
                                                 FillBehavior="Stop"
                                                 Storyboard.TargetProperty="Opacity" />
                            </Storyboard>
                        </BeginStoryboard>
                    </EventTrigger.Actions>
                </EventTrigger>
            </Style.Triggers>
        </Style>

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

        </Style>

    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="auto" />
            <RowDefinition Height="auto" />
        </Grid.RowDefinitions>
        <Border Grid.Row="0"
                x:Name="QuickActionErrorContainer"
                Padding="7.5"
                Margin="0 7.5 0 0"
                Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
                CornerRadius="10">
            <ScrollViewer HorizontalScrollBarVisibility="Auto"
                          VerticalScrollBarVisibility="Auto">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickAction.Result.ErrorInfo}"
                               Margin="0 0 0 3"
                               Foreground="{DynamicResource Color.Red}" />
                    <Grid x:Name="QuickActionErrorGrid"
                          Grid.Row="1">
                        <Grid.Resources>
                            <Style TargetType="Border">
                                <Setter Property="Padding"
                                        Value="5 0" />
                            </Style>
                        </Grid.Resources>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>
                        <Grid Grid.Column="0"
                              Margin="8 0 0 0">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0"
                                       x:Name="ResultCodeLabel"
                                       Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickAction.Result.ErrorInfo.ResultCode}"/>
                            <TextBlock Grid.Row="1"
                                       x:Name="ErrorCodeLabel"
                                       Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickAction.Result.ErrorInfo.ErrorCode}" />
                            <TextBlock Grid.Row="2"
                                       x:Name="ErrorDescrLabel"
                                       Text="{Binding Converter={StaticResource LanguageConverter}, ConverterParameter=QuickAction.Result.ErrorInfo.ErrorDescription}" />
                        </Grid>
                        <Grid Grid.Column="1">
                            <Grid.RowDefinitions>
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                                <RowDefinition Height="auto" />
                            </Grid.RowDefinitions>
                            <TextBlock Grid.Row="0"
                                       x:Name="ResultCodeText"
                                       Margin="3 0 0 0"
                                       Cursor="{DynamicResource Cursor.Copy}"
                                       MouseLeftButtonUp="ValueTextBlock_Click"
                                       TouchDown="ValueTextBlock_Click" />
                            <TextBlock Grid.Row="1"
                                       x:Name="ErrorCodeText"
                                       Margin="3 0 0 0"
                                       Cursor="{DynamicResource Cursor.Copy}"
                                       MouseLeftButtonUp="ValueTextBlock_Click"
                                       TouchDown="ValueTextBlock_Click" />
                            <TextBlock Grid.Row="2"
                                       x:Name="ErrorDescrText"
                                       Margin="3 0 0 0"
                                       Cursor="{DynamicResource Cursor.Copy}"
                                       MouseLeftButtonUp="ValueTextBlock_Click"
                                       TouchDown="ValueTextBlock_Click" />
                        </Grid>
                    </Grid>
                </Grid>
            </ScrollViewer>
        </Border>
        <Border Grid.Row="1"
                Padding="7.5"
                Background="{DynamicResource BackgroundColor.Menu.MainCategory}"
                CornerRadius="10"
                Margin="0 7.5 0 0">
            <DockPanel>
                <ico:AdaptableIcon DockPanel.Dock="Left"
                                   x:Name="PartyPopperGif"
                                   Visibility="Collapsed"
                                   SelectedInternGif="partyPopper" />

                <ScrollViewer HorizontalScrollBarVisibility="Auto"
                              VerticalScrollBarVisibility="Auto">
                    <Grid x:Name="QuickActionResultGrid">
                        <Grid.Resources>
                            <Style TargetType="Border">
                                <Setter Property="Padding"
                                        Value="5 0" />
                            </Style>
                        </Grid.Resources>
                    </Grid>
                </ScrollViewer>

            </DockPanel>
        </Border>
    </Grid>

</UserControl>
