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
|
<Window x:Class="HandBrakeWPF.Views.StaticPreviewView"
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" SizeToContent="WidthAndHeight"
TextOptions.TextFormattingMode="Display"
WindowStartupLocation="CenterScreen"
cal:Message.Attach="[Event SizeChanged] = [Action PreviewSizeChanged($eventArgs)]"
Title="{Binding Title}">
<Window.Resources>
<converters:BooleanToVisibilityConverter x:Key="booleanToVisibilityConverter" />
</Window.Resources>
<Grid>
<StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Background="LightGray" Visibility="{Binding PreviewNotAvailable, Converter={StaticResource booleanToVisibilityConverter}}">
<TextBlock Text="No Preview Available" VerticalAlignment="Center" Padding="60,60,60,60" FontWeight="Bold" FontSize="25" Foreground="DarkGray" />
</StackPanel>
<Image Source="{Binding PreviewImage}" MaxWidth="{Binding Width}" MaxHeight="{Binding Height}" />
<Border BorderBrush="WhiteSmoke" BorderThickness="1,1,1,1" CornerRadius="8,8,8,8" Padding="8"
VerticalAlignment="Bottom" HorizontalAlignment="Center" Margin="20" MinWidth="400" Background="Black" Opacity="0.70">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions></Grid.ColumnDefinitions>
<Slider Maximum="{Binding TotalPreviews}" Minimum="0"
Value="{Binding SelectedPreviewImage}"
VerticalAlignment="Center"
HorizontalAlignment="Stretch"
Background="Transparent" TickPlacement="TopLeft"
Margin="0,0,0,5"
/>
<StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Left">
<Button Content="Live Preview" Padding="8,2" cal:Message.Attach="[Event Click] = [Action Play]" />
<TextBlock Margin="10,0,5,0" VerticalAlignment="Center" Foreground="White" Text="Duration:" />
<ComboBox Width="60"
ItemsSource="{Binding AvailableDurations}"
SelectedItem="{Binding Duration}" />
<CheckBox VerticalAlignment="Center" Content="Use system default player" Foreground="White" Margin="10,0,0,0" IsChecked="{Binding UseSystemDefaultPlayer}" />
</StackPanel>
<StackPanel Orientation="Horizontal" Grid.Row="2" Margin="0,5,0,0">
</StackPanel>
<Grid Margin="0,10,10,0" Grid.Row="2" Visibility="{Binding IsEncoding, Converter={StaticResource booleanToVisibilityConverter}}">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="23*" />
<ColumnDefinition Width="289*"/>
<ColumnDefinition Width="Auto" MinWidth="50" />
</Grid.ColumnDefinitions>
<ProgressBar MinHeight="5" Maximum="100" Minimum="0" Value="{Binding PercentageValue}" Grid.Column="0" Grid.ColumnSpan="2" />
<TextBlock Margin="5,0,0,0" Text="{Binding Percentage}" Grid.Column="2" HorizontalAlignment="Right" Foreground="White" />
</Grid>
</Grid>
</Border>
</Grid>
</Window>
|