<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             xmlns:dialogs="clr-namespace:GalaxyBudsClient.Interface.ViewModels.Dialogs"
             xmlns:ic="clr-namespace:FluentIcons.Avalonia.Fluent;assembly=FluentIcons.Avalonia.Fluent"
             xmlns:ui="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
             xmlns:i18N="clr-namespace:GalaxyBudsClient.Generated.I18N"
             xmlns:ext="clr-namespace:GalaxyBudsClient.Interface.MarkupExtensions"
             mc:Ignorable="d"
             Padding="0, 5, 0, 0"
             x:CompileBindings="True"
             x:DataType="dialogs:TouchActionEditorDialogViewModel"
             x:Class="GalaxyBudsClient.Interface.Dialogs.TouchActionEditorDialog">

    <Design.DataContext>
        <dialogs:TouchActionEditorDialogViewModel />
    </Design.DataContext>

    <StackPanel MinWidth="400" Spacing="16">
        <StackPanel Spacing="12">
            <TextBlock Text="{ext:Translate {x:Static i18N:Keys.CactAction}}" />
            <ComboBox HorizontalAlignment="Stretch"
                      DisplayMemberBinding="{Binding ., Converter={StaticResource EnumDescriptionConverter}}"
                      ItemsSource="{Binding ActionModeSource}"
                      SelectedValue="{Binding ActionMode}" />
        </StackPanel>

        <StackPanel Spacing="10" IsVisible="{Binding IsEventParameterEditable}">
            <TextBlock Text="{ext:Translate {x:Static i18N:Keys.CactFunctionParam}}" />
            <ComboBox HorizontalAlignment="Stretch"
                      DisplayMemberBinding="{Binding ., Converter={StaticResource EnumDescriptionConverter}}"
                      ItemsSource="{Binding EventSource}"
                      SelectedValue="{Binding EventParameter}" />
        </StackPanel>

        <StackPanel Spacing="10" IsVisible="{Binding IsPathParameterEditable}">
            <TextBlock Text="{ext:Translate {x:Static i18N:Keys.CactPathParam}}" />
            <Grid ColumnDefinitions="*,4,Auto">
                <TextBox HorizontalAlignment="Stretch"
                         Text="{Binding PathParameter}" />
                <Button Grid.Column="2"
                        Command="{Binding DoFilePickCommand}">
                    <ic:SymbolIcon Symbol="Folder" />
                </Button>
            </Grid>
        </StackPanel>

        <StackPanel Spacing="10" IsVisible="{Binding IsHotkeyParameterEditable}">
            <TextBlock Text="{ext:Translate {x:Static i18N:Keys.CactHotkeyParam}}" />
            <Grid ColumnDefinitions="*,4,Auto">
                <TextBox HorizontalAlignment="Stretch"
                         IsReadOnly="True"
                         Text="{Binding HotkeyParameter}" />
                <Button Grid.Column="2"
                        Command="{Binding DoHotkeyRecordCommand}">
                    <ic:SymbolIcon Symbol="Keyboard" />
                </Button>
            </Grid>
        </StackPanel>

        <ui:InfoBar Title="{ext:Translate {x:Static i18N:Keys.Hint}}"
                    IsOpen="True"
                    IsClosable="False"
                    Severity="Informational"
                    Message="{Binding InfoBoxMessage}" />
    </StackPanel>
</UserControl>