1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
<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"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters" mc:Ignorable="d"
Title="{Binding Title}"
Width="350" SizeToContent="Height">
<Window.Resources>
<Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />
<Converters:EnumComboConverter x:Key="enumComboConverter" />
</Window.Resources>
<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="24" Height="24" 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="125" Grid.Row="2" Grid.Column="1" HorizontalAlignment="Left"
ItemsSource="{Binding PictureSettingsModes, Converter={StaticResource enumComboConverter}}"
SelectedItem="{Binding SelectedPictureSettingMode, Converter={StaticResource enumComboConverter}}"/>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Visibility="{Binding ShowCustomInputs, Converter={StaticResource boolToVisConverter}}" 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"
IsCancel="True" cal:Message.Attach="[Event Click] = [Action Cancel]" />
<Button Content="Add" Padding="8,2" Margin="0,5,10,5" Grid.Column="2"
IsDefault="True" cal:Message.Attach="[Event Click] = [Action Add]" />
</Grid>
</Grid>
</Window>
|