<Window x:Class="HandBrakeWPF.Views.AddPresetView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org"
        mc:Ignorable="d" 
             Title="{Binding Title}" 
             Width="350" Height="310">

    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="#FFF1F0EF">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        
        <!-- Header -->
        <StackPanel Orientation="Horizontal" Grid.Row="0"  Background="White" Height="30" Margin="0,0,0,10" >
            <Image Source="Images/Add16.png" Margin="10,0,5,0" Width="16" Height="16" VerticalAlignment="Center" />
            <StackPanel Orientation="Vertical" VerticalAlignment="Center">
                <TextBlock Text="Add a Preset" FontWeight="Bold" />
            </StackPanel>
        </StackPanel>

        <Grid Margin="10,0,10,0" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="100" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!-- Name -->
            <TextBlock Text="Preset Name:" Grid.Row="0" Grid.Column="0" />
            <TextBox Width="150" Text="{Binding Preset.Name}" Grid.Row="0" Grid.Column="1"  HorizontalAlignment="Left"/>

            <!-- Settings -->
            <TextBlock Text="Picture Settings:" FontWeight="Bold"  Grid.Row="1" Grid.Column="0" Margin="0,20,0,0" />

            <TextBlock Text="Use Picture Size:"  Grid.Row="2" Grid.Column="0" />
            <ComboBox Width="100" ItemsSource="{Binding PictureSettingModes}" SelectedItem="{Binding SelectedPictureMode}"  Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left" />

            <StackPanel Orientation="Horizontal" Margin="0,10,0,0"  Grid.Row="3" Grid.Column="1">
                <TextBox Width="50" Text="{Binding CustomWidth}" />
                <TextBlock Text="X" FontWeight="Bold" Margin="10,0,10,0" />
                <TextBox Width="50" Text="{Binding CustomHeight}" />
            </StackPanel>

            <CheckBox Content="Use Picture Filters" IsChecked="{Binding Preset.UsePictureFilters}" Margin="0,10,0,0"  Grid.Row="4" Grid.Column="1"/>

            <!-- Description -->
            <TextBlock Text="Description:" FontWeight="Bold" Grid.Row="5" Grid.Column="0" />
            <TextBox Text="{Binding Preset.Description}" Grid.Row="6" Grid.ColumnSpan="2"  HorizontalAlignment="Stretch"/>
        </Grid>

        <!-- Controls -->
        <Grid Background="LightGray" Grid.Row="3" Margin="0,20,0,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <Button Content="Cancel" Padding="8,2" Margin="0,5,10,5" Grid.Column="1" cal:Message.Attach="[Event Click] = [Action Cancel]" />
            <Button Content="Add" Padding="8,2" Margin="0,5,10,5" Grid.Column="2" cal:Message.Attach="[Event Click] = [Action Add]" />
        </Grid>

    </Grid>
</Window>
