<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:avalonia="clr-namespace:Material.Icons.Avalonia;assembly=Material.Icons.Avalonia"
             xmlns:adaptionHints="clr-namespace:Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.AdaptionHints"
             xmlns:shared="clr-namespace:Artemis.UI.Shared;assembly=Artemis.UI.Shared"
             xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="Artemis.UI.Screens.ProfileEditor.ProfileTree.Dialogs.AdaptionHints.CategoryAdaptionHintView"
             x:DataType="adaptionHints:CategoryAdaptionHintViewModel">
    <Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto">
        <StackPanel Grid.ColumnSpan="2" Margin="0 0 0 5">
            <TextBlock Classes="h5">Category hint</TextBlock>
            <TextBlock Classes="subtitle">Applies the layer to devices of a certain category</TextBlock>
        </StackPanel>

        <Button Grid.Row="0"
                Grid.Column="1"
                Classes="icon-button"
                VerticalAlignment="Top"
                HorizontalAlignment="Right"
                ToolTip.Tip="Remove hint"
                Command="{CompiledBinding Remove}">
            <avalonia:MaterialIcon Kind="Delete" />
        </Button>

        <StackPanel Grid.Row="1" Grid.Column="0" Orientation="Horizontal" Spacing="5">
            <shared:EnumComboBox Value="{CompiledBinding CategoryAdaptionHint.Category}" Width="200" Margin="0 0 10 0" />

            <TextBlock VerticalAlignment="Center">Skip</TextBlock>
            <controls:NumberBox HorizontalAlignment="Stretch"
                                Value="{CompiledBinding CategoryAdaptionHint.Skip}"
                                Minimum="0" />
            <TextBlock VerticalAlignment="Center">device(s)</TextBlock>

            <TextBlock VerticalAlignment="Center">Take</TextBlock>
            <controls:NumberBox IsEnabled="{CompiledBinding CategoryAdaptionHint.LimitAmount}"
                                HorizontalAlignment="Stretch"
                                Value="{CompiledBinding CategoryAdaptionHint.Amount}"
                                Minimum="1" />
            <TextBlock VerticalAlignment="Center">device(s)</TextBlock>
        </StackPanel>

        <CheckBox Grid.Row="1"
                  Grid.Column="1"
                  Content="Take all devices"
                  VerticalAlignment="Center"
                  HorizontalAlignment="Right"
                  IsChecked="{CompiledBinding !CategoryAdaptionHint.LimitAmount}" />
    </Grid>
</UserControl>