<Window x:Class="FFXIV_TexTools.Views.Wizard.EditImcGroupWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        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:local="clr-namespace:FFXIV_TexTools.Views.Wizard"
        xmlns:metadata="clr-namespace:FFXIV_TexTools.Views.Metadata"
        mc:Ignorable="d"
        Title="Imc Group Editor" Height="740" Width="800">
    <Window.Resources>
        <DataTemplate x:Key="RowTemplate">
            <local:ImcOptionRow></local:ImcOptionRow>
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="280"></RowDefinition>
            <RowDefinition Height="1*"></RowDefinition>
            <RowDefinition Height="40"></RowDefinition>
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0" Header="Basic Settings">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="200"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Label Content="Group Name:" HorizontalAlignment="Right" VerticalAlignment="Center"></Label>
                <TextBox Grid.Column="1" Text="{Binding Path=GroupName}" Width="200" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBox>

                <Button Content="Item Set:" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Margin="5,5,5,5" Click="ChangeItemSet_Click"/>
                <Label Grid.Column="3" Content="{Binding Path=ItemSetText}" VerticalAlignment="Center" Margin="5,5,5,5"/>

                <Label Grid.Column="4" Content="Group Priority:" HorizontalAlignment="Right" VerticalAlignment="Center"></Label>
                <TextBox Grid.Column="5" Text="{Binding Path=GroupPriority}" Width="100" VerticalAlignment="Center" HorizontalAlignment="Left"></TextBox>

                <Label Grid.Row="1" Grid.Column="0" Content="Variant:" HorizontalAlignment="Right" VerticalAlignment="Center"></Label>
                <TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Path=Variant}" Width="100" HorizontalAlignment="Left" VerticalAlignment="Center"></TextBox>
                
                <CheckBox x:Name="IncludeDisableBox" Grid.Row="1" Grid.Column="2" Grid.ColumnSpan="2" Margin="5" Checked="IncludeDisable_Checked" Unchecked="IncludeDisable_Unchecked" Content="Include Disable Option"></CheckBox>

                <CheckBox Grid.Row="1" Grid.Column="4" Grid.ColumnSpan="2" Margin="5" Content="Apply to All Variants" IsChecked="{Binding Path=AllVariants}"></CheckBox>

                <metadata:ImcVariantEditor Grid.Row="2" Grid.ColumnSpan="6" x:Name="VariantEditor"></metadata:ImcVariantEditor>
                
            </Grid>
        </GroupBox>

        <GroupBox Grid.Row="1" Header="Options">
            <Grid>

                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="1*"/>
                </Grid.RowDefinitions>
                <Button Content="Add Option" Width="150" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5,5,5,5" Click="AddOption_Click"></Button>
                
                <ListView x:Name="OptionList" Grid.Row="1" ItemTemplate="{StaticResource RowTemplate}" ItemsSource="{Binding Path=Options}">

                </ListView>
            </Grid>
        </GroupBox>

        <Button Content="Done" Grid.Row="2" Width="150" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Click="Done_Click"></Button>
    </Grid>
</Window>
