summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/MainView.xaml
blob: 57f2cb51838cd6b4dabb530e5138da63dffa34e3 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
<UserControl x:Class="HandBrakeWPF.Views.MainView"
             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:Converters="clr-namespace:HandBrakeWPF.Converters"
             xmlns:Properties="clr-namespace:HandBrakeWPF.Properties"
             xmlns:cal="http://www.caliburnproject.org"
             xmlns:menu="clr-namespace:HandBrakeWPF.Commands.Menu"
             AllowDrop="True"
             FontSize="11"
             cal:Message.Attach="[Event Loaded] = [Action Load]"
             SnapsToDevicePixels="True"
             UseLayoutRounding="True">

    <UserControl.Resources>
        <Converters:BooleanConverter x:Key="booleanConverter" />
        <Converters:PresetsMenuConverter x:Key="presetsMenuConverter"/>

        <Style TargetType="Button">
            <Setter Property="Padding" Value="8,2" />
            <Setter Property="FontSize" Value="11.5" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="MinHeight" Value="22" />
        </Style>

        <Converters:BooleanToVisibilityConverter x:Key="boolToVisConverter" />

    </UserControl.Resources>

    <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <!--  Menu and Taskbar  -->
        <StackPanel Grid.Row="0"
                    HorizontalAlignment="Stretch"
                    VerticalAlignment="Stretch"
                    Orientation="Vertical">
            <!--  Main Menu  -->
            <Menu Height="23"
                  HorizontalAlignment="Stretch"
                  VerticalAlignment="Top">
                <MenuItem Header="_File">
                    <MenuItem Header="Choose Source" cal:Message.Attach="[Event Click] = [Action SelectSourceWindow]" InputGestureText="Alt + O" />
                    <Separator />
                    <MenuItem Header="_Exit" cal:Message.Attach="[Event Click] = [Action ExitApplication]"  InputGestureText="Alt + F4" />
                </MenuItem>

                <MenuItem Header="_Tools">
                    <MenuItem Header="_Show Queue" cal:Message.Attach="[Event Click] = [Action OpenQueueWindow]" InputGestureText="Ctrl + Q">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Queue_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <MenuItem Header="_Activity Log" cal:Message.Attach="[Event Click] = [Action OpenLogWindow]"  InputGestureText="Ctrl + L">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Output_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator />
                    <MenuItem Header="_Preferences" cal:Message.Attach="[Event Click] = [Action OpenOptionsWindow]">
                        <MenuItem.Icon>
                            <Image Width="16" Source="Images/Pref_Small.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                </MenuItem>

                <MenuItem Header="_Presets" x:Name="presetMenu" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">

                    <MenuItem Header="_Presets" ItemsSource="{Binding PresetsCategories, Converter={StaticResource presetsMenuConverter}}" />
                    <Separator />
                    <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
                    <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetManage}" cal:Message.Attach="[Event Click] = [Action PresetManage]" />
                    <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetRemove}" cal:Message.Attach="[Event Click] = [Action PresetRemove]" />
                    <Separator />
                    <MenuItem Header="_Import from file" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
                    <MenuItem Header="_Export to file" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
                    <Separator />
                    <MenuItem Header="_Set Current as Default" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
                    <MenuItem Header="_Reset Built-In Presets" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
                </MenuItem>

                <MenuItem Header="_Queue" x:Name="queueMenu" Visibility="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
                    <MenuItem Header="Show Queue" cal:Message.Attach="[Event Click] = [Action OpenQueueWindow]"  InputGestureText="Ctrl + Q" />
                    <Separator />
                    <MenuItem Header="Add to Queue" cal:Message.Attach="[Event Click] = [Action AddAllToQueue]"  InputGestureText="Ctrl + A" />
                    <MenuItem Header="All Selection to Queue" cal:Message.Attach="[Event Click] = [Action AddSelectionToQueue]" />
                    <Separator Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.ClearCompleted}" Header="{x:Static Properties:ResourcesUI.QueueView_ClearCompleted}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.ClearAll}" Header="{x:Static Properties:ResourcesUI.QueueView_ClearAll}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.ClearSelected}" Header="{x:Static Properties:ResourcesUI.QueueView_ClearSelected}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <Separator Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.Import}" Header="{x:Static Properties:ResourcesUI.QueueView_Import}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                    <MenuItem Command="{Binding QueueCommand}" CommandParameter="{x:Static menu:QueueCommandParams.Export}" Header="{x:Static Properties:ResourcesUI.QueueView_Export}" Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}" />
                </MenuItem>

                <MenuItem Header="_Help">
                    <MenuItem Header="_HandBrake Documentation (HTTP)" cal:Message.Attach="[Event Click] = [Action LaunchHelp]" InputGestureText="F1">
                        <MenuItem.Icon>
                            <Image Width="16" Height="16"  Source="Images/information.png" />
                        </MenuItem.Icon>
                    </MenuItem>
                    <Separator Visibility="{Binding IsUWP, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
                    <MenuItem Header="_Check for Updates" cal:Message.Attach="[Event Click] = [Action CheckForUpdates]" Visibility="{Binding IsUWP, Converter={StaticResource boolToVisConverter}, ConverterParameter=true}" />
                    <Separator />
                    <MenuItem Header="_About..." cal:Message.Attach="[Event Click] = [Action OpenAboutApplication]" />
                </MenuItem>
            </Menu>

            <!--  ToolBar  -->
            <ToolBar Name="mainToolBar"
                     HorizontalAlignment="Stretch"
                     VerticalAlignment="Stretch"
                     SnapsToDevicePixels="False"
                     ToolBar.OverflowMode="Never"
                     ToolBarTray.IsLocked="True"
                     KeyboardNavigation.TabNavigation="Continue">

                <Button Name="SelectSource" x:Uid="Choose Source" AutomationProperties.Name="Choose Source"
                        cal:Message.Attach="[Event Click] = [Action SelectSourceWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               Source="Images/Movies.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="{x:Static Properties:ResourcesUI.MainView_SourceOpen}"/>
                    </StackPanel>
                </Button>

                <Separator />

                <Button Name="Start" AutomationProperties.Name="Start Encode"
                        cal:Message.Attach="[Event Click] = [Action StartEncode]"
                        Visibility="{Binding IsEncoding,
                                             Converter={StaticResource boolToVisConverter},
                                             ConverterParameter=true}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               Source="Images/Play.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="{Binding StartLabel, FallbackValue='{x:Static Properties:ResourcesUI.MainView_StartEncode}'}"/>
                    </StackPanel>
                </Button>

                <Button Name="Stop" AutomationProperties.Name="Stop Encode"
                        cal:Message.Attach="[Event Click] = [Action StopEncode]"
                        Visibility="{Binding IsEncoding,
                                             Converter={StaticResource boolToVisConverter},
                                             ConverterParameter=false}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/stop.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="{x:Static Properties:ResourcesUI.MainView_Stop}"/>
                    </StackPanel>
                </Button>

                <Button Name="Pause" AutomationProperties.Name="Pause"
                        cal:Message.Attach="[Event Click] = [Action PauseEncode]"
                        Visibility="{Binding CanPause,
                                             Converter={StaticResource boolToVisConverter},
                                             ConverterParameter=false}">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/Pause.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="{x:Static Properties:ResourcesUI.MainView_Pause}"/>
                    </StackPanel>
                </Button>

                <Button PreviewMouseLeftButtonDown="AddToQueue_PreviewMouseDown" ContextMenuService.IsEnabled="False" AutomationProperties.Name="Add to Queue">
                    <StackPanel Orientation="Horizontal">
                        <StackPanel Orientation="Horizontal">
                            <Image Width="32" Height="32" SnapsToDevicePixels="True" Source="Images/AddToQueue_small.png" />
                            <Label Margin="8,0,0,0" VerticalAlignment="Center" Content="{x:Static Properties:ResourcesUI.MainView_AddToQueue}" />
                        </StackPanel>

                        <Grid x:Name="dropdown" Background="Transparent" >
                            <Path Height="5" Margin="2,2,2,0" VerticalAlignment="Center" HorizontalAlignment="Center"
                                  Data="M 0 0 L 4 4 L 8 0 Z"
                                  Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrow" />
                        </Grid>

                    </StackPanel>
                    <Button.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="Add Current" cal:Message.Attach="[Event Click] = [Action AddToQueue]" AutomationProperties.Name="Add Current" />
                            <MenuItem Header="Add All" cal:Message.Attach="[Event Click] = [Action AddAllToQueue]" AutomationProperties.Name="Add all to Queue" />
                            <MenuItem Header="Add Selection" cal:Message.Attach="[Event Click] = [Action AddSelectionToQueue]" AutomationProperties.Name="Add Selection to Queue" />
                        </ContextMenu>
                    </Button.ContextMenu>

                </Button>

                <Button Name="ShowQueue" AutomationProperties.Name="Show Queue" cal:Message.Attach="[Event Click] = [Action OpenQueueWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/Queue_small.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="{Binding QueueLabel, FallbackValue='{x:Static Properties:ResourcesUI.MainView_ShowQueue}'}"/>
                    </StackPanel>
                </Button>

                <Separator />

                <Button Name="Preview" AutomationProperties.Name="Preview Encode" cal:Message.Attach="[Event Click] = [Action OpenPreviewWindow]" >
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               SnapsToDevicePixels="True"
                               Source="Images/picture_small.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Preview"/>
                    </StackPanel>
                </Button>

                <Button Name="ActivityWindow" AutomationProperties.Name="Activity Window" cal:Message.Attach="[Event Click] = [Action OpenLogWindow]">
                    <StackPanel Orientation="Horizontal">
                        <Image Width="32"
                               Height="32"
                               Source="Images/ActivityWindow.png"/>
                        <Label Margin="8,0,0,0"
                               VerticalAlignment="Center"
                               Content="Activity Log"/>
                    </StackPanel>
                </Button>
            </ToolBar>
        </StackPanel>

        <!--  Main Body  -->
        <Grid Grid.Row="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <!--  Main Controls  -->
            <StackPanel Orientation="Vertical" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}">
                <!--  Source  -->
                <StackPanel Margin="10,5,5,5"
                            HorizontalAlignment="Stretch"
                            VerticalAlignment="Stretch">
                    <Grid HorizontalAlignment="Stretch" Margin="0,0,10,0">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="Auto" />
                            <ColumnDefinition Width="*" />
                        </Grid.ColumnDefinitions>

                        <Label Content="{x:Static Properties:ResourcesUI.MainView_Source}" FontWeight="Bold" Grid.Column="0" />
                        <TextBlock Text="{Binding Path=SourceLabel}" TextTrimming="CharacterEllipsis" Grid.Column="1" MaxWidth="400" />
                        <TextBlock Text="{Binding SourceInfo}" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="Gray" FontFamily="Segoe UI Light" Grid.Column="2" MaxWidth="400" />
                    </Grid>

                    <StackPanel Orientation="Horizontal">
                        <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Title}" />
                        <ComboBox Name="Titles"
                                  MinWidth="100"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding ScannedSource.Titles}"
                                  ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Title}"
                                  SelectedItem="{Binding Path=SelectedTitle}" />
                        <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Angle}" />

                        <ComboBox Name="Angles"
                                  MinWidth="60"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding Angles}"
                                  SelectedItem="{Binding SelectedAngle}"
                                  ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Angle}" />
                        <ComboBox Name="PointToPointMode"
                                  MinWidth="80"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding RangeMode}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Range}"
                                  SelectedItem="{Binding SelectedPointToPoint}" />
                        <ComboBox Name="StartPoint"
                                  MinWidth="60"
                                  Margin="8,0,0,0"
                                  ItemsSource="{Binding StartEndRangeItems}"
                                  SelectedItem="{Binding SelectedStartPoint}"
                                  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=true}" />
                        <Controls:TimeSpanBox  Number="{Binding SelectedStartPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                               Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
                                               MinWidth="80" Margin="8,0,0,0"  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=false}" />

                        <Label Margin="4,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_through}" />
                        <ComboBox Name="EndPoint"
                                  MinWidth="60"
                                  Margin="4,0,0,0"
                                  ItemsSource="{Binding StartEndRangeItems}"
                                  SelectedItem="{Binding SelectedEndPoint}"
                                  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=true}" />
                        <Controls:TimeSpanBox  Number="{Binding SelectedEndPoint, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                                               Minimum="0" AllowEmpty="False" ShowTimeSpan="{Binding IsTimespanRange}"
                                               MinWidth="80" Margin="8,0,0,0"  Visibility="{Binding ShowTextEntryForPointToPointMode,
                                                       Converter={StaticResource boolToVisConverter},
                                                       ConverterParameter=false}" />

                        <Label Margin="4,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_Duration}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Duration}" />
                        <Label Margin="4,0,0,0" Content="{Binding Duration}" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Duration}" />

                    </StackPanel>
                </StackPanel>
            </StackPanel>

            <!--  Presets Options  -->
            <StackPanel Grid.Row="1" Orientation="Vertical"  Margin="10,5,10,5">
                <Label Content="Presets" FontWeight="Bold" VerticalAlignment="Center" />
                <StackPanel Orientation="Horizontal" Margin="8,0,0,0">
                    <ComboBox ItemsSource="{Binding PresetsCategories}" SelectedItem="{Binding SelectedPresetCategory}" Width="150" DisplayMemberPath="Category"  Margin="5,0,0,0" VerticalAlignment="Center" />
                    <ComboBox ItemsSource="{Binding CategoryPresets}" SelectedItem="{Binding SelectedPreset}" Width="250" Margin="10,0,0,0" VerticalAlignment="Center">
                        <ComboBox.Resources>
                            <Style TargetType="ToolTip">
                                <Style.Resources>
                                    <Style TargetType="ContentPresenter">
                                        <Style.Resources>
                                            <Style TargetType="TextBlock">
                                                <Setter Property="TextWrapping" Value="Wrap" />
                                            </Style>
                                        </Style.Resources>
                                    </Style>
                                </Style.Resources>
                                <Setter Property="MaxWidth" Value="400" />
                            </Style>
                        </ComboBox.Resources>
                        
                        <ComboBox.ItemTemplate>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" ToolTip="{Binding Description}" ToolTipService.InitialShowDelay="1500">
                                    <StackPanel.Resources>
                                        <Style TargetType="TextBlock">
                                            <Setter Property="FontStyle" Value="Normal" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Path=IsDefault}" Value="True">
                                                    <Setter Property="FontStyle" Value="Italic" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>

                                    </StackPanel.Resources>
                                    <TextBlock Text="{Binding Name}" />
                                    <TextBlock Text="(Default)" Visibility="{Binding IsDefault, Converter={StaticResource boolToVisConverter}}" Margin="5,0,0,0" />
                                </StackPanel>
                            </DataTemplate>
                        </ComboBox.ItemTemplate>
                    </ComboBox>

                    <Button Content="Reload" cal:Message.Attach="[Event Click] = [Action PresetSelect]"  Margin="15,0,0,0" VerticalAlignment="Center" />
                    <Button Content="Save Custom Preset" cal:Message.Attach="[Event Click] = [Action PresetAdd]"  Margin="5,0,0,0" VerticalAlignment="Center" />

                    <Button x:Name="MorePresetOptionsButton"  Margin="15,0,0,0" VerticalAlignment="Center" Click="MorePresetOptionsButton_OnClick">
                        <Button.Content>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Margin="0,0,5,0" Padding="0"
                                       VerticalAlignment="Center"
                                       Text="{x:Static Properties:ResourcesUI.MainView_Options}" />

                                <Path Height="5" Margin="2,2,0,0" VerticalAlignment="Center" HorizontalAlignment="Center"
                                  Data="M 0 0 L 4 4 L 8 0 Z"
                                  Fill="{DynamicResource GlyphBrush}" x:Name="dropdownArrowPreset" />
                            </StackPanel>
                        </Button.Content>

                        <Button.ContextMenu>
                            <ContextMenu x:Name="MainContextMenu" PlacementRectangle="{Binding RelativeSource={RelativeSource Self}}">
                                <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_SetDefault}" cal:Message.Attach="[Event Click] = [Action PresetSetDefault]" />
                                <Separator />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_UpdateSelectedPreset}" cal:Message.Attach="[Event Click] = [Action PresetUpdate]" />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetManage}" cal:Message.Attach="[Event Click] = [Action PresetManage]" />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_PresetRemove}" cal:Message.Attach="[Event Click] = [Action PresetRemove]" />
                                <Separator />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Import}" cal:Message.Attach="[Event Click] = [Action PresetImport]" />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.Preset_Export}" cal:Message.Attach="[Event Click] = [Action PresetExport]" />
                                <Separator />
                                <MenuItem Header="{x:Static Properties:ResourcesUI.MainView_ResetBuiltInPresets}" cal:Message.Attach="[Event Click] = [Action PresetReset]" />
                            </ContextMenu>
                        </Button.ContextMenu>
                    </Button>
                </StackPanel>
            </StackPanel>

            <!--  Tab Control  -->
            <TabControl Name="tabControl" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
                        Grid.Row="2"
                        Margin="15,10,10,6"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch"
                        SelectionChanged="TabControl_OnSelectionChanged"
                        Visibility="{Binding IsQueueShowingInLine,  Converter={StaticResource boolToVisConverter}, ConverterParameter=true}">
                <TabItem Name="summaryTab" Header="{x:Static Properties:ResourcesUI.MainView_SummaryTab}">
                    <ContentControl x:Name="SummaryViewModel" />
                </TabItem>
                <TabItem Name="pictureTab" Header="{x:Static Properties:ResourcesUI.MainView_PictureTab}">
                    <ContentControl x:Name="PictureSettingsViewModel" />
                </TabItem>
                <TabItem Name="filtersTab" Header="{x:Static Properties:ResourcesUI.MainView_FiltersTab}">
                    <ContentControl x:Name="FiltersViewModel" />
                </TabItem>
                <TabItem Name="videoTab" Header="{x:Static Properties:ResourcesUI.MainView_VideoTab}">
                    <ContentControl x:Name="VideoViewModel" VerticalAlignment="Stretch" />
                </TabItem>
                <TabItem Name="audioTab" Header="{x:Static Properties:ResourcesUI.MainView_AudioTab}">
                    <ContentControl x:Name="AudioViewModel" />
                </TabItem>
                <TabItem Name="subtitlesTab" Header="{x:Static Properties:ResourcesUI.MainView_SubtitlesTab}">
                    <ContentControl x:Name="SubtitleViewModel" />
                </TabItem>
                <TabItem Name="chaptersTab" Header="{x:Static Properties:ResourcesUI.MainView_ChaptersTab}">
                    <ContentControl x:Name="ChaptersViewModel" />
                </TabItem>
                <TabItem Name="advancedTab" Header="{x:Static Properties:ResourcesUI.MainView_AdvancedTab}" Visibility="{Binding CurrentTask.ShowAdvancedTab, Converter={StaticResource boolToVisConverter}}">
                    <ContentControl x:Name="AdvancedViewModel" />
                </TabItem>
            </TabControl>

            <!-- Queue in-line display if enabled -->
            <Grid  Grid.Row="2" Grid.Column="0" Margin="10,10,10,5"  Visibility="{Binding IsQueueShowingInLine, Converter={StaticResource boolToVisConverter}, ConverterParameter=false}"
                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <Label Content="Queue" FontWeight="Bold" Grid.Row="0"/>
                <ContentControl x:Name="QueueViewModel" cal:View.Context="Embedded" Margin="5,0,0,0"  Grid.Row="1" />
            </Grid>

            <!--  Destination  -->
            <StackPanel Grid.Row="3" IsEnabled="{Binding HasSource, Converter={StaticResource booleanConverter}, ConverterParameter=false}"
                        Margin="10,5,10,15"
                        HorizontalAlignment="Stretch"
                        VerticalAlignment="Stretch">
                <Label Content="{x:Static Properties:ResourcesUI.MainView_Destination}" FontWeight="Bold" />
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="58" />
                        <ColumnDefinition Width="24"/>
                        <ColumnDefinition Width="17*" />
                        <ColumnDefinition Width="972*"/>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <Label Margin="8,0,0,0" Content="{x:Static Properties:ResourcesUI.MainView_File}" Grid.ColumnSpan="2" />
                    <TextBox Name="Destination"
                             Grid.Column="2"
                             Margin="8,0,0,0" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Destination}"
                             Text="{Binding Destination,
                                            UpdateSourceTrigger=PropertyChanged}" Grid.ColumnSpan="2">
                        <TextBox.ContextMenu>
                            <ContextMenu>
                                <MenuItem Header="Open this Directory" cal:Message.Attach="[Event Click] = [Action OpenDestinationDirectory]" />
                            </ContextMenu>
                        </TextBox.ContextMenu>
                    </TextBox>
                    <Button Name="DestinationBrowser"
                            Grid.Column="4"
                            Margin="8,2,0,1" FontWeight="Bold"
                            Content="Browse"
                            ToolTip="{x:Static Properties:ResourcesTooltips.MainView_Browse}"
                            cal:Message.Attach="[Event Click] = [Action BrowseDestination]"
                    />
                </Grid>
            </StackPanel>

        </Grid>

        <!-- Source Selection-->
        <Controls:SourceSelection x:Name="sourceSelection"
                                  Grid.Row="0" Grid.RowSpan="3"
                                  Visibility="{Binding ShowSourceSelection, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
                                  VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                  Panel.ZIndex="10" />

        <Controls:StatusPanel x:Name="loadingPanel"
                              Grid.Row="0"
                              Grid.RowSpan="3"
                              Visibility="{Binding ShowStatusWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
                              VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                              Panel.ZIndex="10"
                              IsLoading="{Binding ShowStatusWindow}"
                              Message="Please wait ..."
                              SubMessage="{Binding StatusLabel}"
                              ActionText="Cancel"
                              SecondaryActionText="Open Log Window"
                              SecondaryAction="{Binding OpenLogWindowAction}"
                              CancelAction="{Binding CancelAction}" />

        <Controls:AlertPanel x:Name="alertPanel"
                             Grid.Row="0"
                             Grid.RowSpan="3"
                             Visibility="{Binding ShowAlertWindow, Converter={StaticResource boolToVisConverter}, ConverterParameter=false, TargetNullValue=Collapsed, FallbackValue=Collapsed}"
                             VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                             Panel.ZIndex="10"
                             Message="{Binding AlertWindowHeader}"
                             SubMessage="{Binding AlertWindowText}"
                             ActionText="OK"
                             DefaultAction="{Binding AlertWindowClose}">

        </Controls:AlertPanel>

        <!--  Status Bar  -->
        <StatusBar Name="statusBar1" Height="32" Grid.Row="2" Grid.ColumnSpan="2"  HorizontalAlignment="Stretch" VerticalAlignment="Bottom">

            <StatusBarItem>
                <ProgressBar Value="{Binding ProgressPercentage}" Visibility="{Binding IsEncoding, Converter={StaticResource boolToVisConverter}}"
                             Width="100" Height="18" VerticalAlignment="Center" />
            </StatusBarItem>
            <StatusBarItem>
                <TextBlock Text="{Binding Path=ProgramStatusLabel}" TextTrimming="CharacterEllipsis" />
            </StatusBarItem>
            <StatusBarItem HorizontalAlignment="Right" ToolTip="{x:Static Properties:ResourcesTooltips.MainView_WhenDone}">
                <Menu Background="Transparent" >
                    <MenuItem>
                        <MenuItem.Header>
                            <StackPanel VerticalAlignment="Center" Orientation="Horizontal" MinHeight="26">
                                <TextBlock VerticalAlignment="Center" FontWeight="Bold" Text="{x:Static Properties:ResourcesUI.QueueView_WhenDone}" />
                                <TextBlock Margin="8,0,0,0" VerticalAlignment="Center" Text="{Binding QueueViewModel.WhenDoneAction}" />
                                <Path Height="5"
                                      Margin="2,2,2,0"
                                      Data="M 0 0 L 4 4 L 8 0 Z"
                                      Fill="{DynamicResource GlyphBrush}" />
                            </StackPanel>
                        </MenuItem.Header>

                        <MenuItem x:Name="doNothing"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(doNothing.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_DoNothing}" />
                        <MenuItem x:Name="shutdownSystem"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(shutdownSystem.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_Shutdown}" />
                        <MenuItem x:Name="suspend"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(suspend.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_Suspend}"/>
                        <MenuItem x:Name="hibernate"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(hibernate.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_Hibernate}" />
                        <MenuItem x:Name="lock"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(lock.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_LockSystem}" />
                        <MenuItem x:Name="logoff"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(logoff.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_Logoff}"/>
                        <MenuItem x:Name="quit"
                                  cal:Message.Attach="[Event Click] = [Action WhenDone(quit.Header)]"
                                  Header="{x:Static Properties:ResourcesUI.QueueView_QuitHandBrake}" />
                    </MenuItem>
                </Menu>
            </StatusBarItem>
        </StatusBar>
    </Grid>
</UserControl>