 <UserControl x:Class="HandBrakeWPF.Views.Standalone.CropPanelView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:controls="clr-namespace:HandBrakeWPF.Controls"
              xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
              xmlns:picture="clr-namespace:HandBrakeWPF.Converters.Picture">

    <UserControl.Resources>
        <picture:CropModeConverter x:Key="cropModeConverter" />
        <Style TargetType="controls:NumberBox">
            <Setter Property="Height" Value="24" />
        </Style>
    </UserControl.Resources>

    <Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
        </Grid.ColumnDefinitions>

        <!-- Crop Panel -->
        <TextBlock Text="{x:Static Properties:Resources.StaticPreviewView_FineTuning}" Style="{StaticResource sectionHeader}" Margin="0,5,0,10" Foreground="White" />
        <Grid Name="CropPanel" Margin="0,0,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" Grid.Row="1">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="Auto" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!--<TextBlock Text="{x:Static Properties:Resources.FiltersView_Rotate}" Margin="0,0,0,0" Grid.Row="0" Grid.Column="0" Foreground="White" />
            <ComboBox Width="120" ItemsSource="{Binding RotateFlipFilter.RotationOptions}" Grid.Row="0" Grid.Column="1"
                      SelectedItem="{Binding RotateFlipFilter.SelectedRotation}" ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Rotate}"
                      AutomationProperties.Name="{x:Static Properties:Resources.FiltersView_Rotate}" HorizontalAlignment="Left" VerticalAlignment="Center" />
            <CheckBox Content="{x:Static Properties:Resources.FiltersView_FlipVideo}" Margin="5,0,0,0" VerticalAlignment="Center" IsChecked="{Binding RotateFlipFilter.FlipVideo, UpdateSourceTrigger=PropertyChanged}"
                      ToolTip="{x:Static Properties:ResourcesTooltips.FilterView_Flip}" Grid.Row="0" Grid.Column="2" HorizontalAlignment="Left"  />-->


            <TextBlock Text="{x:Static Properties:Resources.PictureSettingsView_Cropping}" Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" Margin="0,0,0,0" Foreground="White"  />

            <StackPanel Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Orientation="Horizontal" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="10,0,0,0" >
                <ComboBox Width="110" ItemsSource="{Binding CropModes, Converter={StaticResource cropModeConverter}}" SelectedItem="{Binding SelectedCropMode, Converter={StaticResource cropModeConverter}}" HorizontalAlignment="Left" 
                          ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_AutoCrop}"
                          AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Cropping}" />
            </StackPanel>


            <Grid Margin="0,5,0,0" Grid.Row="2" Grid.ColumnSpan="3" HorizontalAlignment="Right">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <Label Content="{x:Static Properties:Resources.PictureSettingsView_Top}" Grid.Row="0" Grid.Column="2" VerticalAlignment="Center" Foreground="White"  />
                <Label Content="{x:Static Properties:Resources.PictureSettingsView_Bottom}" Grid.Row="4" Grid.Column="2" VerticalAlignment="Center" Foreground="White"  />
                <Label Content="{x:Static Properties:Resources.PictureSettingsView_Left}" Grid.Row="2" Grid.Column="0" HorizontalAlignment="Center" Foreground="White"  />
                <Label Content="{x:Static Properties:Resources.PictureSettingsView_Right}" Grid.Row="2" Grid.Column="4" HorizontalAlignment="Center" Foreground="White"  />

                <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="1" Grid.Column="2"
                                    Minimum="0" Maximum="{Binding MaxCropTB}" Modulus="2" Number="{Binding CropTop, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
                                    ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropTop}"
                                    AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Top}" />

                <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="3" Grid.Column="2"
                                    Minimum="0" Maximum="{Binding MaxCropTB}"  Modulus="2" Number="{Binding CropBottom, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
                                    ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropBottom}"
                                    AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Bottom}" />

                <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="1"
                                    Minimum="0" Maximum="{Binding MaxCropLR}"  Modulus="2" Number="{Binding CropLeft, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
                                    ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropLeft}"
                                    AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Left}"/>

                <controls:NumberBox Width="60" HorizontalAlignment="Left" Margin="0,0,0,5" IsEnabled="{Binding IsCustomCrop}" Grid.Row="2" Grid.Column="3"
                                    Minimum="0" Maximum="{Binding MaxCropLR}"  Modulus="2" Number="{Binding CropRight, Mode=TwoWay}" UpdateBindingOnTextChange="True" ShowIncrementButtons="True" AllowEmpty="False"
                                    ToolTip="{x:Static Properties:ResourcesTooltips.PictureSettingsView_CropRight}"
                                    AutomationProperties.Name="{x:Static Properties:Resources.PictureSettingsView_Right}"/>

            </Grid>

        </Grid>

    </Grid>

</UserControl>
