<Window x:Class="HandBrakeWPF.Views.PreviewView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:cal="http://www.caliburnproject.org"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        Title="{Binding Title}"
        Width="390"
        Style="{StaticResource windowStyle}"
        ResizeMode="NoResize"
        SizeToContent="Height"
        WindowStartupLocation="CenterScreen"
        TextOptions.TextFormattingMode="Display"
        mc:Ignorable="d">

    <Window.Resources>
        <Style TargetType="Button">
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="Padding" Value="5,1" />
            <Setter Property="FontSize" Value="11.5" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>
    </Window.Resources>

    <StackPanel Orientation="Vertical">

        <StackPanel Height="34"
                    Margin="0,0,0,10"
                    Orientation="Horizontal">

            <StackPanel.Style>
                <Style TargetType="StackPanel">
                    <Style.Triggers>
                        <DataTrigger Binding="{Binding UseSystemColours}" Value="False">
                            <Setter Property="Background" Value="White" />
                        </DataTrigger>
                    </Style.Triggers>
                </Style>
            </StackPanel.Style>

            <Image Width="32"
                   Height="32"
                   Margin="10,0,5,0"
                   VerticalAlignment="Center"
                   Source="Images/picture_small.png" />
            <StackPanel VerticalAlignment="Center" Orientation="Vertical">
                <TextBlock FontWeight="Bold" Text="Create a video preview" />
            </StackPanel>
        </StackPanel>

        <StackPanel Margin="10,0,0,0" Orientation="Horizontal">
            <TextBlock Margin="0,0,5,0"
                       VerticalAlignment="Center"
                       Text="Start at Preview:" />
            <ComboBox Width="60"
                      ItemsSource="{Binding StartPoints}"
                      SelectedItem="{Binding StartAt}" />

            <TextBlock Margin="10,0,5,0"
                       VerticalAlignment="Center"
                       Text="Duration:" />
            <ComboBox Width="60"
                      ItemsSource="{Binding AvailableDurations}"
                      SelectedItem="{Binding Duration}" />
        </StackPanel>

        <Grid Margin="10,10,10,0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" MinWidth="50" />
            </Grid.ColumnDefinitions>
            <ProgressBar MinHeight="22" Maximum="100" Minimum="0" Value="{Binding PercentageValue}" Grid.Column="0" />
            <TextBlock Margin="5,0,0,0" Text="{Binding Percentage}" Grid.Column="1" />
        </Grid>

        <StackPanel Margin="10,10,0,10" Orientation="Horizontal">
            <CheckBox VerticalAlignment="Center"
                      Content="Use system default player"
                      IsChecked="{Binding UseSystemDefaultPlayer}" />
            <Button Margin="10,0,0,0"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Center"
                    cal:Message.Attach="[Event Click] = [Action Play]"
                    Content="Play"
                    IsDefault="True"
                    Padding="8,2" />
        </StackPanel>
    </StackPanel>
</Window>
