<mah:MetroWindow
        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"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:models="clr-namespace:FFXIV_TexTools.Models"
        xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
        xmlns:Controls="clr-namespace:FFXIV_TexTools.Views.Controls"
        x:Class="FFXIV_TexTools.Views.EditWizardGroupWindow"
        mc:Ignorable="d"
        xmlns:resx="clr-namespace:FFXIV_TexTools.Resources"
        resx:Localization.Enabled="True"              
        Title="{Binding Source={x:Static resx:UIStrings.Add_Group}}" Height="1000" Width="1000" WindowStartupLocation="CenterOwner" ShowMaxRestoreButton="False" ShowMinButton="False" Closing="MetroWindow_Closing">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="454*"/>
            <RowDefinition Height="8*"/>
            <RowDefinition Height="445*"/>
        </Grid.RowDefinitions>
        <GroupBox Grid.Row="0" Header="{Binding Source={x:Static resx:UIStrings.Group_Settings}}">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition/>
                    <ColumnDefinition Width="180"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Label Content="{Binding Source={x:Static resx:UIStrings.Group_Title_colon}}" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                <TextBox x:Name="ModGroupTitle" Grid.Column="1" VerticalAlignment="Center" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Enter_a_Name_for_the_Group_here}}" MinWidth="100"/>
                <Grid Grid.Column="2">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <Label Content="Group Priority:" HorizontalAlignment="Right" VerticalAlignment="Center"></Label>
                    <TextBox x:Name="PriorityBox" Grid.Column="1" VerticalAlignment="Center"></TextBox>
                </Grid>
                <Grid Grid.Column="3" Margin="10,0,0,0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <RadioButton x:Name="SingleSelectRadioButton" Grid.Column="0" Content="{Binding Source={x:Static resx:UIStrings.Single_Selection}}" Margin="0,0,10,0" IsChecked="True"/>
                    <RadioButton x:Name="MultiSelectRadioButton" Grid.Column="1" Content="{Binding Source={x:Static resx:UIStrings.Multi_Selection}}"/>
                    <Button x:Name="DoneButton" Grid.Column="2" Content="{Binding Source={x:Static resx:UIStrings.Done}}" Click="DoneButton_Click"/>
                </Grid>
            </Grid>
        </GroupBox>
        <Grid Grid.Row="1">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="600"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Grid Grid.Column="0">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="1.5*"/>
                    </Grid.ColumnDefinitions>
                    <GroupBox Grid.Column="0" Header="{Binding Source={x:Static resx:UIStrings.Group_Options}}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="Auto"/>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <Grid Grid.Row="0">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="OptionNameTextBox" Grid.Column="0" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Option_Name}}" Margin="0,0,10,0" KeyDown="OptionNameTextBox_KeyDown"/>
                                <Button x:Name="AddOptionButton" Grid.Column="1" Content="{Binding Source={x:Static resx:UIStrings.Add}}" Click="AddOptionButton_Click"/>
                            </Grid>
                            <ListBox x:Name="OptionList" Grid.Row="1" SelectionChanged="OptionList_SelectionChanged" Margin="5"/>
                            <Grid Grid.Row="2">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="1*"/>
                                    <ColumnDefinition Width="1*"/>
                                    <ColumnDefinition Width="Auto"/>
                                    <ColumnDefinition Width="Auto"/>
                                </Grid.ColumnDefinitions>
                                <Button x:Name="RemoveOptionButton" Grid.Column="0" Content="{Binding Source={x:Static resx:UIStrings.Remove}}" Click="RemoveOptionButton_Click" IsEnabled="False"/>
                                <Button x:Name="RenameOptionButton" Grid.Column="1" Content="{Binding Source={x:Static resx:UIStrings.Rename}}" Click="RenameOptionButton_Click" IsEnabled="False"/>
                                <Button x:Name="MoveOptionUpButton" Grid.Column="2" Content="{iconPacks:FontAwesome Kind=ArrowUpSolid}" Click="MoveOptionUpButton_Click" IsEnabled="False"/>
                                <Button x:Name="MoveOptionDownButton" Grid.Column="3" Content="{iconPacks:FontAwesome Kind=ArrowDownSolid}" Click="MoveOptionDownButton_Click" IsEnabled="False"/>
                            </Grid>
                        </Grid>
                    </GroupBox>

                    <Grid Grid.Column="1">
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition Height="2*"/>
                        </Grid.RowDefinitions>
                        <GroupBox Grid.Row="0" Header="{Binding Source={x:Static resx:UIStrings.Option_Description}}">
                            <TextBox x:Name="OptionDescription" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Enter_a_description_for_the_selected_option_here_dot}}" LostFocus="OptionDescription_LostFocus" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto" AcceptsReturn="True"/>
                        </GroupBox>
                        <GroupBox Grid.Row="1" Header="{Binding Source={x:Static resx:UIStrings.Option_Preview_Image}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition/>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Image x:Name="OptionImage" />
                                <Button x:Name="OptionImageButton" Grid.Row="1" Background="Transparent" Content="{Binding Source={x:Static resx:UIStrings.Clic_here_to_add_a_preview_image}}" Click="OptionImageButton_Click"/>
                            </Grid>
                        </GroupBox>
                    </Grid>
                </Grid>
                <Grid Grid.Column="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"></RowDefinition>
                        <RowDefinition></RowDefinition>
                        <RowDefinition Height="Auto"></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid Grid.Row="0">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="40"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="100"/>
                            <ColumnDefinition/>
                        </Grid.ColumnDefinitions>
                        <Label Grid.Column="0" HorizontalAlignment="Right" VerticalAlignment="Center">Option Priority</Label>
                        <TextBox Text="{Binding Path=OptionPriority}" Grid.Column="1" HorizontalAlignment="Left" VerticalAlignment="Center" Width="100"></TextBox>
                    </Grid>
                    
                    <GroupBox Grid.Row="1" Header="{Binding Source={x:Static resx:UIStrings.Included_Mods_in_Option}}">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition/>
                                <RowDefinition Height="Auto"/>
                            </Grid.RowDefinitions>
                            <ListBox x:Name="IncludedModsList" Grid.Row="0" Margin="5" DisplayMemberPath="Name" SelectionChanged="IncludedModsList_SelectionChanged" SelectionMode="Extended"/>
                            <Button x:Name="RemoveModItemButton" Grid.Row="1" Content="{Binding Source={x:Static resx:UIStrings.Remove}}" Click="RemoveModItemButton_Click"/>
                        </Grid>
                    </GroupBox>

                    <GroupBox Grid.Row="2" Header="Metadata Manipulations">
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition></RowDefinition>
                                <RowDefinition></RowDefinition>
                            </Grid.RowDefinitions>

                            <Label x:Name="ManipulationCountLabel" Content="- Manipulations" FontWeight="Bold"></Label>
                            <Button x:Name="EditManipulationsButton" Grid.Row="1" Margin="5" Content="View/Edit Manipulations" Click="EditManipulations_Click"></Button>
                            
                        </Grid>
                    </GroupBox>
                </Grid>
            </Grid>
        </Grid>
        <Grid x:Name="ModListGrid" Grid.Row="2" Grid.RowSpan="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition Width="2*"/>
            </Grid.ColumnDefinitions>
            <GroupBox Header="Item List">
                <Controls:ItemSelectControl x:Name="ItemList" MainMenuMode="True" ExpandCharacterMenu="True" Margin="0" Width="Auto" Height="Auto" />
            </GroupBox>
            <GroupBox x:Name="SelectModGroup" Grid.Column="1" Header="{Binding Source={x:Static resx:UIStrings.Select_Mod}}">
                <mah:MetroTabControl x:Name="TabsControl" Grid.Column="2" mah:TabControlHelper.Underlined="TabPanel">
                    <TabItem x:Name="MetadataTabItem" Header="Metadata">
                        <GroupBox Header="Metadata Options">
                            <Grid>

                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="300"/>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="150"/>
                                </Grid.ColumnDefinitions>
                                <TextBox x:Name="MetadataPathBox" IsReadOnly="true" Grid.ColumnSpan="1" Margin="5,0" VerticalAlignment="Center"/>
                                <CheckBox x:Name="MetadataIncludeChildFilesBox" Content="Include Child Files" IsChecked="True" Grid.Row="0" Grid.Column="1" Margin="5,0" VerticalAlignment="Center"/>
                                <Button x:Name="AddMetadataButton" Grid.Column="2" Grid.Row="0" Content="Add Existing" VerticalAlignment="Center" Click="AddMetadataButton_Click" Margin="5,0" IsEnabled="False" ToolTip="{x:Static resx:UIStrings.AddToModpackTooltip}"/>
                                <Button x:Name="AddNewMetadata" Grid.Column="2" Grid.Row="1" Content="Load External" VerticalAlignment="Center" Margin="5,0" Click="AddNewMetadata_Click" IsEnabled="False" ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>
                            </Grid>
                        </GroupBox>
                    </TabItem>
                    <TabItem x:Name="ModelTabItem" Header="Models">
                        <GroupBox Header="{Binding Source={x:Static resx:UIStrings.Model_Options}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="300"/>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="150"/>
                                </Grid.ColumnDefinitions>

                                <ComboBox x:Name="ModelTypeComboBox" Grid.Row="0" Grid.Column="0" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Model_Type}}" VerticalAlignment="Center" Margin="5,0" DisplayMemberPath="Name"/>
                                <CheckBox x:Name="ModelIncludeChildFilesBox" Content="Include Child Files" IsChecked="True" Grid.Row="0" Grid.Column="1" Margin="5,0" VerticalAlignment="Center"/>
                                <Button x:Name="AddCurrentModelButton" Grid.Column="2" Content="Add Existing" VerticalAlignment="Center" Margin="5,0" Click="AddCurrentModelButton_Click" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.AddToModpackTooltip}"/>
                                <Button x:Name="AddRawModel" Grid.Column="2" Grid.Row="1" Content="Load" VerticalAlignment="Center" Margin="5,0" Click="AddRawModel_Click" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>
                            </Grid>
                        </GroupBox>
                    </TabItem>
                    <TabItem x:Name="MaterialTabItem" Header="Materials" HorizontalAlignment="Left">
                        <GroupBox Header="{Binding Source={x:Static resx:UIStrings.Material_Options}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="300"/>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="150"/>
                                </Grid.ColumnDefinitions>
                                <ComboBox x:Name="MaterialComboBox" Grid.Row="0" Grid.Column="0"  mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Material}}" VerticalAlignment="Center" Margin="5,0" DisplayMemberPath="Name"/>

                                <CheckBox x:Name="MaterialIncludeChildrenBox" Content="Include Child Files" IsChecked="True" Grid.Row="0" Grid.Column="1" Margin="5,0" VerticalAlignment="Center"/>
                                <Button x:Name="AddCurrentMaterialButton" Grid.Column="2" Grid.Row="0" Content="Add Existing" VerticalAlignment="Center" Click="AddCurrentMaterialButton_Click" Margin="5,0" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.AddToModpackTooltip}"/>

                                <Button x:Name="AddWithCustomColorsetButton" Grid.Column="1" Grid.ColumnSpan="2" Grid.Row="1" Content="Add with Custom Colorset" VerticalAlignment="Center" Click="AddWithCustomColorsetButton_Click" Margin="5,0" IsEnabled="False" HorizontalAlignment="Right" Width="180"  ToolTip="{x:Static resx:UIStrings.AddCustomToModpackTooltip}"/>
                                <Button x:Name="AddCustomMaterialButton" Grid.Column="2" Grid.Row="2" Content="Load External" VerticalAlignment="Center" Click="AddCustomMaterialButton_Click" Margin="5,0" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>

                            </Grid>
                        </GroupBox>
                    </TabItem>
                    <TabItem x:Name="TextureTabItem" Header="Textures">
                        <GroupBox Header="{Binding Source={x:Static resx:UIStrings.Texture_Options}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition Height="40"/>
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="300"/>
                                    <ColumnDefinition Width="150"/>
                                    <ColumnDefinition Width="150"/>
                                </Grid.ColumnDefinitions>

                                <ComboBox x:Name="TextureMapComboBox" Grid.Row="0" mah:TextBoxHelper.Watermark="{Binding Source={x:Static resx:UIStrings.Texture_Map}}" VerticalAlignment="Center" DisplayMemberPath="Name" Margin="5,0"/>
                                <Button x:Name="AddCurrentTextureButton" Grid.Column="2" Content="Add Existing" VerticalAlignment="Center" Click="AddCurrentTextureButton_Click" Margin="5,0" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.AddToModpackTooltip}"/>
                                <Button x:Name="AddCustomTextureButton" Grid.Column="2" Grid.Row="1" Content="Load External" VerticalAlignment="Center" Click="AddCustomTextureButton_Click" Margin="5,0" IsEnabled="False"  ToolTip="{x:Static resx:UIStrings.LoadToModpackTooltip}"/>
                            </Grid>
                        </GroupBox>
                    </TabItem>
                    <TabItem x:Name="ModpackTabItem" Header="Modpack">
                        <GroupBox Header="{Binding Source={x:Static resx:UIStrings.Modpack_Options}}">
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="40"/>
                                    <RowDefinition />
                                </Grid.RowDefinitions>
                                <Grid Grid.Row="0">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                        <ColumnDefinition />
                                    </Grid.ColumnDefinitions>
                                    <Button x:Name="LoadSimpleModpackButton" Content="{Binding Source={x:Static resx:UIStrings.Load_Modpack}}" Click="LoadSimpleModpackButton_Click" HorizontalAlignment="Left" VerticalAlignment="Center" Width="150" Margin="5,0" />
                                    <Button x:Name="SelectAllButton" Click="SelectAllButton_Click" Content="{Binding Source={x:Static resx:UIStrings.Select_All}}" Grid.Column="1" VerticalAlignment="Center" Margin="5,0" IsEnabled="False" />
                                    <Button x:Name="DeselectAllButton" Click="DeselectAllButton_Click" Content="{Binding Source={x:Static resx:UIStrings.Deselect_All}}" Grid.Column="2" VerticalAlignment="Center" Margin="5,0" IsEnabled="False" />
                                    <Button x:Name="AddButton" Click="AddButton_Click" Content="Add File(s)" Grid.Column="3" VerticalAlignment="Center" Margin="5,0" IsEnabled="False" />
                                </Grid>
                                <ListView Style="{x:Null}" x:Name="ModpackContents" Grid.Row="1" SelectionMode="Extended" SelectionChanged="ModpackContents_SelectionChanged" BorderBrush="Black" BorderThickness="0,1" AlternationCount="2">
                                    <ListView.View>
                                    <GridView  x:Name="GridViewCol">
                                        <GridViewColumn Header="Name" DisplayMemberBinding="{Binding Path=Name}"/>
                                        <GridViewColumn Header="{Binding Source={x:Static resx:UIStrings.FileName}}" DisplayMemberBinding="{Binding Path=FilePath}"/>
                                    </GridView>
                                    </ListView.View>
                                </ListView>
                            </Grid>
                        </GroupBox>

                    </TabItem>
                </mah:MetroTabControl>
            </GroupBox>
        </Grid>
    </Grid>
</mah:MetroWindow>
