<mah:MetroWindow x:Class="FFXIV_TexTools.Views.Projects.ProjectWindow"
        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.Projects"
        xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
        mc:Ignorable="d"
        Title="TexTools Project" Height="450" Width="1100">
    <mah:MetroWindow.Resources>

        <DataTemplate x:Key="FileEntryTemplate">
            <Grid Height="40">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="30"/>
                    <ColumnDefinition Width="400"/>
                    <ColumnDefinition Width="10"/>
                    <ColumnDefinition Width="400"/>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition Width="100"/>
                </Grid.ColumnDefinitions>

                <TextBox Grid.Column="1" Text="{Binding Path=InternalPath}" IsReadOnly="True" VerticalAlignment="Center"></TextBox>
                <TextBox Grid.Column="3" Text="{Binding Path=ExternalPath}" IsReadOnly="True"  VerticalAlignment="Center"></TextBox>
                <Button Grid.Column="4" Content="Clear" VerticalAlignment="Center" Margin="5,0" Click="ClearFile_Click"></Button>
                <Button Grid.Column="5" Content="Change" VerticalAlignment="Center" Margin="5,0" Click="ChangeFile_Click"></Button>
            </Grid>
        </DataTemplate>
    </mah:MetroWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="40"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="1*"/>
        </Grid.RowDefinitions>

        <Grid Grid.Row="0" x:Name="TopRow">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition Width="150"/>
                <ColumnDefinition/>
                <ColumnDefinition Width="150"/>
            </Grid.ColumnDefinitions>
            <Button Content="Load Project" VerticalAlignment="Center" Margin="5" Grid.Column="0" Click="LoadButton_Click" Visibility="{Binding Path=OpenVisible}"></Button>
            <Button x:Name="NewButton" Content="New Project" VerticalAlignment="Center" Margin="5" Grid.Column="1" Click="NewButton_Click" Visibility="{Binding Path=OpenVisible}">
                <Button.ContextMenu>
                    <ContextMenu x:Name="NewContextMenu">
                        <MenuItem Header="Blank Project" Click="NewProject_Click"></MenuItem>
                        <MenuItem Header="Live Penumbra Project" Click="NewPenumbra_Click"></MenuItem>
                        <MenuItem Header="Convert Modpack to Project" Click="NewModpack_Click"></MenuItem>
                    </ContextMenu>
                </Button.ContextMenu>
            </Button>
            <Label Grid.Column="2" HorizontalAlignment="Right" VerticalAlignment="Center" Content="The project will remain open even if you close this window." FontStyle="Italic" FontSize="10" Visibility="{Binding Path=CloseVisible}"></Label>
            <Button Content="Close Project" VerticalAlignment="Center" Margin="5" Grid.Column="3" Click="CloseProject_Click" Visibility="{Binding Path=CloseVisible}"></Button>
        </Grid>

        <Separator Grid.Row="1"/>
        
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>

            <GroupBox Grid.Column="0" Margin="5" Header="Transaction Files" Visibility="{Binding Path=CloseVisible}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="40"/>
                        <RowDefinition Height="1*"/>
                    </Grid.RowDefinitions>

                    <Button Content="Remove File(s)" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="5" Width="150" Click="ResetFile_Click"></Button>
                    <Button Content="Add File" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="5" Width="150" Click="AddFile_Click"></Button>
                    <ListBox Grid.Row="1" x:Name="FileListBox" ItemsSource="{Binding Path=FileListSource}" SelectionMode="Extended"
                    ItemTemplate="{StaticResource FileEntryTemplate}"></ListBox>
                </Grid>
            </GroupBox>
        </Grid>

    </Grid>
</mah:MetroWindow>
