<UserControl x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.AdaptionHints.CategoryAdaptionHintView"
             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:Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.AdaptionHints"
             xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
             xmlns:Converters="clr-namespace:Artemis.UI.Converters"
             xmlns:s="https://github.com/canton7/Stylet"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance local:CategoryAdaptionHintViewModel}">
    <UserControl.Resources>
        <Converters:InverseBooleanConverter x:Key="InverseBooleanConverter" />
    </UserControl.Resources>
    <materialDesign:Card Margin="0 5" Padding="10">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>
            <StackPanel Grid.ColumnSpan="3" Margin="0 0 0 5">
                <TextBlock Style="{StaticResource MaterialDesignSubtitle1TextBlock}" Text="Category hint" />
                <TextBlock Style="{StaticResource MaterialDesignBody2TextBlock}" Text="Applies the layer to devices of a certain category" />
            </StackPanel>

            <Button Grid.Row="0"
                    Grid.Column="3"
                    VerticalAlignment="Top"
                    HorizontalAlignment="Right"
                    Style="{StaticResource MaterialDesignIconForegroundButton}"
                    ToolTip="Remove hint"
                    Command="{s:Action Remove}">
                <materialDesign:PackIcon Kind="Delete" />
            </Button>

            <ComboBox Grid.Row="1"
                      Grid.Column="0"
                      Style="{StaticResource MaterialDesignFilledComboBox}"
                      materialDesign:HintAssist.Hint="Category"
                      Margin="0 0 5 0"
                      SelectedValue="{Binding CategoryAdaptionHint.Category}"
                      ItemsSource="{Binding Categories}"
                      SelectedValuePath="Value"
                      DisplayMemberPath="Description" />

            <TextBox Grid.Row="1"
                     Grid.Column="1"
                     Style="{StaticResource MaterialDesignFilledTextBox}"
                     materialDesign:HintAssist.Hint="Skip"
                     materialDesign:TextFieldAssist.SuffixText="device(s)"
                     Margin="5 0"
                     Text="{Binding CategoryAdaptionHint.Skip}" />

            <TextBox Grid.Row="1"
                     Grid.Column="2"
                     Style="{StaticResource MaterialDesignFilledTextBox}"
                     materialDesign:HintAssist.Hint="Take"
                     materialDesign:TextFieldAssist.SuffixText="device(s)"
                     IsEnabled="{Binding TakeAllDevices, Converter={StaticResource InverseBooleanConverter}}"
                     Margin="5 0"
                     Text="{Binding CategoryAdaptionHint.Amount}" />

            <CheckBox Grid.Row="1"
                      Grid.Column="3"
                      Content="Take all devices"
                      VerticalAlignment="Top"
                      Margin="0 18 0 0"
                      IsChecked="{Binding TakeAllDevices}" />
        </Grid>
    </materialDesign:Card>
</UserControl>