<mah:MetroWindow x:Class="FFXIV_TexTools.Views.BackupModPackImporter"
        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:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore"
        mc:Ignorable="d"
        xmlns:resx="clr-namespace:FFXIV_TexTools.Resources"
        resx:Localization.Enabled="True"                     
        Title="{Binding Source={x:Static resx:UIStrings.Backup_Modpack_Importer}}" Height="600" Width="800" IsMinButtonEnabled="False" IsMaxRestoreButtonEnabled="False" WindowStartupLocation="CenterOwner">

    <Grid x:Name="ContentArea">
        <Grid.RowDefinitions>
            <RowDefinition Height="38"/>
            <RowDefinition/>
            <RowDefinition Height="38"/>
        </Grid.RowDefinitions>
        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Label Grid.Column="0" Content="{Binding Source={x:Static resx:UIStrings.Name_colon}}" VerticalAlignment="Center"/>
            <Label x:Name="ModPackName" Grid.Column="1" VerticalAlignment="Center" FontWeight="Bold"/>
        </Grid>
        <Grid Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <GroupBox Grid.Column="0" Header="{Binding Source={x:Static resx:UIStrings.Modpacks_To_Include}}" Margin="5">
                <ListBox x:Name="ModpackList" SelectionChanged="ModpackList_SelectionChanged" ScrollViewer.CanContentScroll="False" Grid.Column="0">
                    <ListBox.GroupStyle>
                        <GroupStyle>
                            <GroupStyle.HeaderTemplate>
                                <DataTemplate>
                                    <Border BorderThickness="0,0,0,1">
                                        <Border.BorderBrush>
                                            <LinearGradientBrush EndPoint="1,0" MappingMode="RelativeToBoundingBox" StartPoint="0,1">
                                                <GradientStop Color="Black" Offset="0"/>
                                                <GradientStop Color="White" Offset="1"/>
                                            </LinearGradientBrush>
                                        </Border.BorderBrush>
                                        <TextBlock FontWeight="Bold" Text="{Binding Name}"/>
                                    </Border>
                                </DataTemplate>
                            </GroupStyle.HeaderTemplate>
                        </GroupStyle>
                    </ListBox.GroupStyle>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <CheckBox IsChecked="{Binding IsChecked}" />
                                <TextBlock Text="{Binding ModpackName}"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </GroupBox>
            <GroupBox Grid.Column="1" Header="{Binding Source={x:Static resx:UIStrings.Description}}" Margin="5">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition/>
                    </Grid.RowDefinitions>
                    <StackPanel Grid.Row="0">
                        <Label Content="{Binding DescriptionModpackName, FallbackValue='ModPack Title'}" MinWidth="80" HorizontalAlignment="Left" FontWeight="Bold"/>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{Binding Source={x:Static resx:UIStrings.Author_colon}}" MinWidth="80"/>
                            <Label Content="{Binding DescriptionModpackAuthor, FallbackValue='0'}" FontWeight="Bold"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="Url:"  MinWidth="80"/>
                            <Label Content="{Binding DescriptionModpackUrl, FallbackValue='0'}" FontWeight="Bold" PreviewMouseLeftButtonDown="DescriptionModPackUrl_PreviewMouseLeftButtonDown" Foreground="#007BFF"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal">
                            <Label Content="{Binding Source={x:Static resx:UIStrings.Version_colon}}" MinWidth="80"/>
                            <Label Content="{Binding DescriptionModpackVersion, FallbackValue='1.0'}" FontWeight="Bold"/>
                        </StackPanel>
                        <Label Content="{Binding Source={x:Static resx:UIStrings.Mod_Pack_Content}}" MinWidth="80"/>
                    </StackPanel>
                    <TextBox Text="{Binding DescriptionModpackContent}" Grid.Row="1" IsReadOnly="True" TextWrapping="Wrap" VerticalScrollBarVisibility="Auto"/>
                </Grid>
            </GroupBox>
        </Grid>
        <Grid Grid.Row="2">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width=".5*"/>
                <ColumnDefinition Width=".5*"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <Button x:Name="SelectAllButton" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="0" Content="{Binding Source={x:Static resx:UIStrings.Select_All}}" Click="SelectAllButton_Click" Margin="5"/>
            <Button x:Name="ClearSelectedButton" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1" Content="{Binding Source={x:Static resx:UIStrings.Clear_Selected}}" Click="ClearSelectedButton_Click" Margin="5"/>
            <StackPanel Grid.Column="2" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button x:Name="CancelButton" Content="{Binding Source={x:Static resx:UIStrings.Cancel}}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Click="CancelButton_Click"/>
                <Button x:Name="CreateModPackButton" Content="{Binding Source={x:Static resx:UIStrings.Import_ModPack}}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="5" Click="ImportModPackButton_Click" />
            </StackPanel>
        </Grid>
    </Grid>
</mah:MetroWindow>
