<mah:MetroWindow x:Name="ImportModelWindow" x:Class="FFXIV_TexTools.Views.Models.ImportModelEditView"
        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:mah="http://metro.mahapps.com/winfx/xaml/controls"
        xmlns:resx="clr-namespace:FFXIV_TexTools.Resources"
        resx:Localization.Enabled="True"                     
        mc:Ignorable="d"
        Title="Model Editor" IsMinButtonEnabled="False" IsMaxRestoreButtonEnabled="False" WindowStartupLocation="CenterOwner" FontSize="14" ResizeMode="NoResize"
                 Width="860"
                 Height="660">
    <Grid x:Name="MainGrid">
        
        <!-- Main Grid Definitions -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="1*"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>

        <Grid Grid.Column="0" Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="45"/>
                <RowDefinition Height="45"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition/>
            </Grid.RowDefinitions>

            <Label Content="Model Settings" Margin="0" VerticalAlignment="Center" HorizontalContentAlignment="Center" FontSize="18" FontWeight="Bold" Height="34"/>

            <Grid Grid.Row="1">
                <Button Margin="10,0" Content="Modify All Vertices" Click="ModifyModel_Click" VerticalAlignment="Center"></Button>
            </Grid>
            
            <Grid Grid.Row="2" Margin="5">
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                    <RowDefinition Height="35"/>
                </Grid.RowDefinitions>
                
                <Grid Grid.Row="0">
                    <Grid.ToolTip>You probably shouldn't change this unless you really know what you're doing.</Grid.ToolTip>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    <Label Grid.Column="0" Content="Mdl Version:" HorizontalAlignment="Right" VerticalAlignment="Center"/>
                    <ComboBox Grid.Column="1"  x:Name="MdlVersionComboBox" VerticalContentAlignment="Center" VerticalAlignment="Center"/>
                </Grid>


                <CheckBox Grid.Row="1" Content="Enable Anistropic Lighting (Hair Only)" Margin="10,0" IsChecked="{Binding Path=EnableAnisotropy}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            <Run>Determines if hair materials should show anisotropic specular highlights.</Run>
                            <LineBreak/>
                            <LineBreak/>
                            <Run>This will make the hair 'shinier', and the specular highlights will be skewed based on UV orientation and Flow Data Settings.</Run>
                            <LineBreak/>
                            <Run>Flow Data may be auto-generated based on UV Layout via the Modify Vertices menus.</Run>
                            <LineBreak/>
                            <LineBreak/>
                            <Run>Turning this off on a hair which is already using it will make the lighting significantly more matte.</Run>
                            <LineBreak/>
                            <Run>Has no effect on non-hair meshes/materials.</Run>
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>

                <CheckBox Grid.Row="2" Content="Disable Shadow Casting" Margin="10,0" IsChecked="{Binding Path=DisableShadows}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Globally disabled shadows for this model.
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>

                <CheckBox Grid.Row="3" Content="Disable Light Shadow (?)" Margin="10,0" IsChecked="{Binding Path=DisableLightShadow}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Disable shadow receiving maybe?
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                <CheckBox Grid.Row="4" Content="Enable Lighting Reflection (?)" Margin="10,0" IsChecked="{Binding Path=EnableLightingReflection}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Some kind of reflection thing?
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                <CheckBox Grid.Row="5" Content="Disable Waving Animation (?)" Margin="10,0" IsChecked="{Binding Path=DisableWavingAnimation}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Water wave effect possibly?
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                
                <CheckBox Grid.Row="6" Content="Unknown Flag (?)" Margin="10,0" IsChecked="{Binding Path=UnknownFlag}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Maybe does something.  Maybe does nothing.
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                <CheckBox Grid.Row="7" Content="Block Rain" Margin="10,0" IsChecked="{Binding Path=OccludeRain}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Determines if the model occludes/blocks rain effects.
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                <CheckBox Grid.Row="8" Content="Block Snow" Margin="10,0" IsChecked="{Binding Path=OccludeSnow}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Determines if the model occludes/blocks snow effects.
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
                <CheckBox Grid.Row="9" Content="Block Dust" Margin="10,0" IsChecked="{Binding Path=OccludeDust}">
                    <CheckBox.ToolTip>
                        <TextBlock>
                            Determines if the model occludes/blocks dust effects.
                        </TextBlock>
                    </CheckBox.ToolTip>
                </CheckBox>
            </Grid>

            <Grid Grid.Row="3" Margin="5, 0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition/>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"/>
                    <RowDefinition Height="100"/>
                </Grid.RowDefinitions>

                <Label Grid.Row="0" Grid.Column="0"  Content="Model Scale:" HorizontalAlignment="Right" VerticalAlignment="Center" />
                <ComboBox Grid.Row="0" Grid.Column="1"  x:Name="ScaleComboBox" VerticalContentAlignment="Top" VerticalAlignment="Center" />

                <Grid x:Name="SizeInfo" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" Margin="5, 0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="20"></RowDefinition>
                        <RowDefinition Height="20"></RowDefinition>
                        <RowDefinition></RowDefinition>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"></ColumnDefinition>
                        <ColumnDefinition></ColumnDefinition>
                    </Grid.ColumnDefinitions>

                    <Label Grid.Column="0"  FontStyle="Italic" FontSize="11" Content="Old Model Size:" HorizontalContentAlignment="Right" Height="24" VerticalAlignment="Center" HorizontalAlignment="Right"/>
                    <Label Grid.Column="0" Grid.Row="1" FontStyle="Italic" FontSize="11" Content="New Model Size:" HorizontalContentAlignment="Right" Height="24" VerticalAlignment="Center" HorizontalAlignment="Right"/>

                    <Label Grid.Column="1" x:Name="OldModelSizeBox"  FontStyle="Italic" FontSize="11" Content="11 Meters" Height="24" HorizontalAlignment="Left" VerticalAlignment="Center"/>
                    <Label Grid.Column="1" Grid.Row="1" x:Name="NewModelSizeBox"  FontStyle="Italic" FontSize="11" Content="11 Meters"  Height="24" HorizontalAlignment="Left" VerticalAlignment="Center"/>


                    <TextBlock x:Name="ScaleWarningBox" Grid.Row="2" FontStyle="Italic" FontSize="12" Text="Warning Text Goes Here" Grid.Column="0" Grid.ColumnSpan="2" TextAlignment="Center" Height="20" VerticalAlignment="Top" TextWrapping="Wrap"/>
                </Grid>
            </Grid>

        </Grid>


        <Grid x:Name="MeshGroupGrid" Grid.Row="1" Grid.Column="1">
            <!-- Mesh Group Grid Definitions -->
            <Grid.RowDefinitions>
                <RowDefinition Height="45"/>
                <RowDefinition Height="45"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="125"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Button Grid.Row="1" Margin="10,0" Content="Modify Mesh Vertices" Click="ModifyMesh_Click" VerticalAlignment="Center"></Button>

            <Grid Grid.Row="0" Margin="5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition Width="100"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Label Grid.Row="0" Grid.Column="0" Content="Mesh:" HorizontalAlignment="Right" VerticalContentAlignment="Center" VerticalAlignment="Center" FontWeight="Bold"/>
                <ComboBox Grid.Row="0" Grid.Column="1"  x:Name="MeshNumberBox"  VerticalContentAlignment="Center" VerticalAlignment="Center" />
                <Button x:Name="DeleteMeshGroupButton" Grid.Column="2" Content="Delete Mesh" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5,5,5,5" Click="DeleteMeshGroup_Click"></Button>
            </Grid>


            <Grid x:Name="MeshGroupSettings" Margin="5" Grid.Row="2">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="40"></RowDefinition>
                </Grid.RowDefinitions>
                <Label Grid.Row="2" Grid.Column="0"  Content="Mesh Type:" HorizontalAlignment="Right" VerticalAlignment="Center"></Label>
                <ComboBox Grid.Row="2" Grid.Column="1"  x:Name="ModelTypeComboBox" VerticalContentAlignment="Center" VerticalAlignment="Center"/>

            </Grid>


            <Border Grid.Row="3" BorderBrush="{DynamicResource NormalBorderBrush}" BorderThickness="1" Margin="10,5,10,10">
                <Grid>
                    <Label Content="Material" Margin="0" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontSize="18" FontWeight="Bold" Height="34"/>
                    <ComboBox x:Name="MaterialSelectorBox" Margin="10,40,10,40" VerticalAlignment="Top" Height="26"/>
                    <TextBox x:Name="MaterialPathTextBox" Height="26" Margin="10,0,10,5" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Bottom" IsEnabled="False"/>
                </Grid>
            </Border>

            <Border Grid.Row="4" BorderBrush="{DynamicResource NormalBorderBrush}" BorderThickness="1" Margin="10,5,10,10">
                <Grid>
                    <Label Content="Shapes" Margin="0,0,0,0" Grid.Row="0" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontSize="18" FontWeight="Bold" Height="34"/>
                    <ListBox x:Name="ShapesListBox" Margin="10,40,10,50" Grid.Row="0" Style="{DynamicResource SimpleListBox}" MinHeight="100"/>
                    <Button x:Name="RemoveShapeButton" Content="Remove Shape" Margin="10,0,10,15" Grid.Row="0" IsEnabled="False" Height="25" VerticalAlignment="Bottom"/>
                </Grid>
            </Border>



        </Grid>
        
        <Grid x:Name="MeshPartGrid" Grid.Row="1" Grid.Column="2">
            <!-- Mesh Part Grid Definitions -->
            <Grid.RowDefinitions>
                <RowDefinition Height="45"/>
                <RowDefinition Height="45"/>
                <RowDefinition Height="45"/>
                <RowDefinition Height="125"/>
                <RowDefinition Height="1*"/>
            </Grid.RowDefinitions>

            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="50"></ColumnDefinition>
                    <ColumnDefinition></ColumnDefinition>
                    <ColumnDefinition Width="100"></ColumnDefinition>
                </Grid.ColumnDefinitions>
                <Label Content="Part:" VerticalContentAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" Grid.Column="0" HorizontalAlignment="Right"/>
                <ComboBox x:Name="PartNumberBox" VerticalContentAlignment="Center" Grid.Column="1" VerticalAlignment="Center" />
                <Button x:Name="DeletePartButton" Content="Delete Part" Grid.Row="0" VerticalAlignment="Center" Grid.Column="2" Margin="5" Click="DeletePart_Click"/>
            </Grid>

            <Button Grid.Row="1" Margin="10,0" Content="Modify Part Vertices" Click="ModifyPart_Click" VerticalAlignment="Center"></Button>

            <Button Grid.Row="2" Margin="10,0" Content="Auto-Assign Simple-Heels Attribute" Click="AssignHeels_Click" VerticalAlignment="Center" ToolTip="Automatically assigns an offset attribute for the SimpleHeels plugin.  Only affects body/leg/foot equipment."></Button>

            <Label Content="Attributes" Margin="10,10,10,0" Grid.Row="3" VerticalAlignment="Top" HorizontalContentAlignment="Center" FontSize="18" FontWeight="Bold" Height="34" Grid.Column="1"/>

            <Rectangle Grid.Row="3" Stroke="{DynamicResource NormalBorderBrush}" Margin="10,5,10,10" Grid.Column="1" Grid.RowSpan="2"/>


            <ComboBox x:Name="AddAttributeBox" Margin="20,50,19,0" Grid.Row="3" VerticalAlignment="Top" Height="26" Grid.Column="1"/>
            <TextBox x:Name="AddAttributeTextBox" Height="26" Margin="20,0,20,15" Grid.Row="3" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Bottom" IsEnabled="False" Grid.Column="1"/>
            
            <ListBox x:Name="AttributesListBox" Margin="20,0,20,50" Grid.Row="4" Style="{DynamicResource SimpleListBox}" Grid.Column="1" MinHeight="150"/>
            <Button x:Name="RemoveAttributeButton" Content="Remove Attribute" Margin="20,0,20,15" Grid.Row="4" Height="27" VerticalAlignment="Bottom" Grid.Column="1" IsEnabled="False"/>


        </Grid>


        <Rectangle Stroke="Transparent" Fill="{DynamicResource NormalBorderBrush}" Width="2" Grid.Row="1" Grid.RowSpan="1" Grid.ColumnSpan="2" />

        <Rectangle Stroke="Transparent" Fill="{DynamicResource NormalBorderBrush}" Width="2" Grid.Row="1" Grid.RowSpan="1" Grid.Column="1" Grid.ColumnSpan="2" />


        <Grid Grid.Row="2" Grid.ColumnSpan="2" x:Name="MeshInfoGrid">
            <Grid.RowDefinitions>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition></ColumnDefinition>
                <ColumnDefinition></ColumnDefinition>
            </Grid.ColumnDefinitions>

        </Grid>


        <Grid Grid.Row="3" x:Name="BottomRow" Grid.ColumnSpan="3">
            <Button x:Name="CancelButton" Content="Cancel" HorizontalAlignment="Left" Width="200" Margin="5" VerticalContentAlignment="Center" Click="CancelButton_Click" VerticalAlignment="Center"/>
            <Button x:Name="ImportButton" Content="Confirm" HorizontalAlignment="Right" Width="200" Margin="5" VerticalContentAlignment="Center" HorizontalContentAlignment="Center" Grid.Column="1" Click="ImportButton_Click" VerticalAlignment="Center"/>
        </Grid>
        
    </Grid>
</mah:MetroWindow>
