summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Views/Controls
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrakeWPF/Views/Controls')
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml8
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs13
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs35
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml6
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml10
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs53
8 files changed, 117 insertions, 41 deletions
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml
index 78c784a37..0eeaff7e8 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml
+++ b/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml
@@ -4,7 +4,8 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
- d:DesignHeight="300" d:DesignWidth="300">
+ d:DesignHeight="300" d:DesignWidth="300"
+ x:Name="advancedView">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
@@ -14,9 +15,8 @@
<TextBlock Text="Advanced" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
- <TextBox Grid.Row="2" Margin="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
-
- </TextBox>
+ <TextBox Grid.Row="2" Margin="10" Text="{Binding Query, RelativeSource={RelativeSource AncestorType=UserControl}}"
+ VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
</Grid>
</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs
index fa9a38d72..f00d972bb 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs
@@ -28,15 +28,22 @@ namespace HandBrakeWPF.Views.Controls
/// <summary>
/// The "Query" Dependancy Property
/// </summary>
- public static readonly DependencyProperty QueryProperty = DependencyProperty.Register("Query", typeof(string), typeof(AdvancedView), new PropertyMetadata(null));
+ public static readonly DependencyProperty QueryProperty = DependencyProperty.Register("Query", typeof(string), typeof(AdvancedView));
/// <summary>
/// Gets or sets State.
/// </summary>
public string Query
{
- get { return (string)this.GetValue(QueryProperty); }
- set { this.SetValue(QueryProperty, value); }
+ get
+ {
+ return (string)this.GetValue(QueryProperty);
+ }
+
+ set
+ {
+ this.SetValue(QueryProperty, value);
+ }
}
}
}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml b/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml
index 5fafa01af..512a1b91d 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml
@@ -18,11 +18,11 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Button Content="Add Track" Grid.Column="0" Width="75" Margin="0,0,10,0" />
- <Button Content="Remove" Grid.Column="1" Width="75" />
+ <Button Content="Add Track" Click="Add" Grid.Column="0" Width="75" Margin="0,0,10,0" />
+ <Button Content="Remove" Click="Remove" Grid.Column="1" Width="75" />
</Grid>
- <DataGrid Grid.Row="2" Margin="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
+ <DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding AudioTracks, RelativeSource={RelativeSource AncestorType=UserControl}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
</DataGrid>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs
index 74fe9e057..417a1226c 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs
@@ -10,7 +10,7 @@
namespace HandBrakeWPF.Views.Controls
{
using System;
- using System.ComponentModel;
+ using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
@@ -27,38 +27,49 @@ namespace HandBrakeWPF.Views.Controls
public AudioView()
{
InitializeComponent();
- this.AudioTracks = new BindingList<AudioTrack>();
}
/// <summary>
/// The "Query" Dependancy Property
/// </summary>
- public static readonly DependencyProperty QueryProperty = DependencyProperty.Register("AudioTracks", typeof(BindingList<AudioTrack>), typeof(AudioView), new PropertyMetadata(null));
-
+ public static readonly DependencyProperty AudioTracksProperty = DependencyProperty.Register("AudioTracks", typeof(ObservableCollection<AudioTrack>), typeof(AudioView));
/// <summary>
/// Gets or sets State.
/// </summary>
- public BindingList<AudioTrack> AudioTracks
+ public ObservableCollection<AudioTrack> AudioTracks
{
- get { return (BindingList<AudioTrack>)this.GetValue(QueryProperty); }
- set { this.SetValue(QueryProperty, value); }
+ get { return (ObservableCollection<AudioTrack>)this.GetValue(AudioTracksProperty); }
+ set { this.SetValue(AudioTracksProperty, value); }
}
+
/// <summary>
- /// Add an audio track.
+ /// Add a new Track
/// </summary>
- public void Add()
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public void Add(object sender, RoutedEventArgs e)
{
this.AudioTracks.Add(new AudioTrack());
}
/// <summary>
- /// Remove an Audio Track
+ /// Remove a Track
/// </summary>
- public void Remove()
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public void Remove(object sender, RoutedEventArgs e)
{
- throw new NotImplementedException("Not Done Yet!");
+ throw new NotImplementedException();
}
}
}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml
index 7e787cf82..5a749a568 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml
+++ b/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml
@@ -20,12 +20,12 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <CheckBox Content="Create chapter markers" Grid.Column="0" VerticalAlignment="Center" />
+ <CheckBox Content="Create chapter markers" IsChecked="{Binding IncludeChapterMarkers, RelativeSource={RelativeSource AncestorType=UserControl}}" Grid.Column="0" VerticalAlignment="Center" />
<Button Content="Import" Grid.Column="2" Width="75" Margin="0,0,10,0" />
<Button Content="Export" Grid.Column="3" Width="75" />
</Grid>
-
- <DataGrid Grid.Row="2" Margin="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
+
+ <DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding Chapters, RelativeSource={RelativeSource AncestorType=UserControl}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
</DataGrid>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs
index 4ad791fb1..a9ef20d95 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs
@@ -11,10 +11,11 @@ namespace HandBrakeWPF.Views.Controls
{
using System;
using System.Collections.Generic;
+ using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
- using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Model.Encoding;
/// <summary>
/// Interaction logic for ChaptersView.xaml
@@ -30,17 +31,31 @@ namespace HandBrakeWPF.Views.Controls
}
/// <summary>
- /// The "Query" Dependancy Property
+ /// The "Chapters" Dependancy Property
/// </summary>
- public static readonly DependencyProperty QueryProperty = DependencyProperty.Register("Chapters", typeof(IList<Chapter>), typeof(ChaptersView), new PropertyMetadata(null));
+ public static readonly DependencyProperty ChaptersProperty = DependencyProperty.Register("Chapters", typeof(ObservableCollection<ChapterMarker>), typeof(ChaptersView));
+
+ /// <summary>
+ /// The "EnableChapterMarkers" Dependancy Property
+ /// </summary>
+ public static readonly DependencyProperty IncludeChaptersProperty = DependencyProperty.Register("IncludeChapterMarkers", typeof(bool), typeof(ChaptersView));
/// <summary>
/// Gets or sets State.
/// </summary>
- public IList<Chapter> Query
+ public IList<ChapterMarker> Chapters
+ {
+ get { return (ObservableCollection<ChapterMarker>)this.GetValue(ChaptersProperty); }
+ set { this.SetValue(ChaptersProperty, value); }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether chapter markers are enabled.
+ /// </summary>
+ public bool IncludeChapterMarkers
{
- get { return (IList<Chapter>)this.GetValue(QueryProperty); }
- set { this.SetValue(QueryProperty, value); }
+ get { return (bool)this.GetValue(IncludeChaptersProperty); }
+ set { this.SetValue(IncludeChaptersProperty, value); }
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml
index a8acf0e5d..8ae5e48d1 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml
@@ -2,7 +2,7 @@
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:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:cal="http://www.caliburnproject.org"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
@@ -19,12 +19,12 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <Button Content="Add" Grid.Column="0" Width="75" Margin="0,0,10,0" />
- <Button Content="Remove" Grid.Column="1" Width="75" Margin="0,0,10,0" />
- <Button Content="Import SRT" Grid.Column="2" Width="75" />
+ <Button Content="Add" Name="AddTrack" Click="Add" Grid.Column="0" Width="75" Margin="0,0,10,0" />
+ <Button Content="Remove" Name="RemoveTrack" Click="Remove" Grid.Column="1" Width="75" Margin="0,0,10,0" />
+ <Button Content="Import SRT" Click="ImportSrt" Grid.Column="2" Width="75" />
</Grid>
- <DataGrid Grid.Row="2" Margin="10" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
+ <DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding SubtitleTracks, RelativeSource={RelativeSource AncestorType=UserControl}}" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
</DataGrid>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs
index ddf717a58..44922c1a6 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs
@@ -9,7 +9,8 @@
namespace HandBrakeWPF.Views.Controls
{
- using System.ComponentModel;
+ using System;
+ using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
@@ -31,15 +32,57 @@ namespace HandBrakeWPF.Views.Controls
/// <summary>
/// The "Query" Dependancy Property
/// </summary>
- public static readonly DependencyProperty QueryProperty = DependencyProperty.Register("SubtitleTracks", typeof(BindingList<SubtitleTrack>), typeof(SubtitlesView), new PropertyMetadata(null));
+ public static readonly DependencyProperty SubtitleTracksProperty = DependencyProperty.Register("SubtitleTracks", typeof(ObservableCollection<SubtitleTrack>), typeof(SubtitlesView));
/// <summary>
/// Gets or sets State.
/// </summary>
- public BindingList<SubtitleTrack> AudioTracks
+ public ObservableCollection<SubtitleTrack> SubtitleTracks
{
- get { return (BindingList<SubtitleTrack>)this.GetValue(QueryProperty); }
- set { this.SetValue(QueryProperty, value); }
+ get { return (ObservableCollection<SubtitleTrack>)this.GetValue(SubtitleTracksProperty); }
+ set { this.SetValue(SubtitleTracksProperty, value); }
+ }
+
+ /// <summary>
+ /// Add a new Track
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public void Add(object sender, RoutedEventArgs e)
+ {
+ this.SubtitleTracks.Add(new SubtitleTrack());
+ }
+
+ /// <summary>
+ /// Remove a Track
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public void Remove(object sender, RoutedEventArgs e)
+ {
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// Import an SRT File.
+ /// </summary>
+ /// <param name="sender">
+ /// The sender.
+ /// </param>
+ /// <param name="e">
+ /// The e.
+ /// </param>
+ public void ImportSrt(object sender, RoutedEventArgs e)
+ {
+ throw new NotImplementedException();
}
}
}