summaryrefslogtreecommitdiffstats
path: root/win/CS
diff options
context:
space:
mode:
authorsr55 <[email protected]>2011-12-30 18:57:30 +0000
committersr55 <[email protected]>2011-12-30 18:57:30 +0000
commitcd3e951792f05944fb9ba4f1bc17e581318bfe8f (patch)
treecc36dcf807b7d371132429fd7a7a5550233ee737 /win/CS
parent1a4342793d9c7054b1a70030787af46f77208288 (diff)
WinGui: (WPF) Move all the main UI tab UserControls into an MVVM format. Mostly code shuffling.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4393 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS')
-rw-r--r--win/CS/HandBrakeWPF/HandBrakeWPF.csproj60
-rw-r--r--win/CS/HandBrakeWPF/README BEFORE WRITING CODE.txt7
-rw-r--r--win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs9
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs13
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs44
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs62
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs (renamed from win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs)70
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs39
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IErrorViewModel.cs6
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs18
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs49
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs3
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs39
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs2
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs1
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs72
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs39
-rw-r--r--win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs17
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml (renamed from win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml)4
-rw-r--r--win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs (renamed from win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs)24
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml (renamed from win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml)12
-rw-r--r--win/CS/HandBrakeWPF/Views/AudioView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/ChaptersView.xaml (renamed from win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml)12
-rw-r--r--win/CS/HandBrakeWPF/Views/ChaptersView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs75
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml.cs15
-rw-r--r--win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs88
-rw-r--r--win/CS/HandBrakeWPF/Views/FiltersView.xaml58
-rw-r--r--win/CS/HandBrakeWPF/Views/FiltersView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/MainView.xaml133
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml (renamed from win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml)2
-rw-r--r--win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml (renamed from win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml)14
-rw-r--r--win/CS/HandBrakeWPF/Views/SubtitlesView.xaml.cs27
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml68
-rw-r--r--win/CS/HandBrakeWPF/Views/VideoView.xaml.cs27
45 files changed, 896 insertions, 449 deletions
diff --git a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
index d91abdb9f..055ee5372 100644
--- a/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
+++ b/win/CS/HandBrakeWPF/HandBrakeWPF.csproj
@@ -93,8 +93,22 @@
<Compile Include="UserSettingConstants.cs" />
<Compile Include="ViewModels\AboutViewModel.cs" />
<Compile Include="ViewModels\AddPresetViewModel.cs" />
+ <Compile Include="ViewModels\AudioViewModel.cs" />
+ <Compile Include="ViewModels\AdvancedViewModel.cs" />
+ <Compile Include="ViewModels\VideoViewModel.cs" />
+ <Compile Include="ViewModels\FiltersViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IFiltersViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IVideoViewModel.cs" />
+ <Compile Include="ViewModels\SubtitlesViewModel.cs" />
+ <Compile Include="ViewModels\ChaptersViewModel.cs" />
+ <Compile Include="ViewModels\PictureSettingsViewModel.cs" />
<Compile Include="ViewModels\ErrorViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IAdvancedViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\ISubtitlesViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IChaptersViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IPictureSettingsViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IAddPresetViewModel.cs" />
+ <Compile Include="ViewModels\Interfaces\IAudioViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IQueueViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IPreviewViewModel.cs" />
<Compile Include="ViewModels\Interfaces\IErrorViewModel.cs" />
@@ -116,18 +130,24 @@
<SubType>Code</SubType>
</Compile>
<Compile Include="ViewModels\MainViewModel.cs" />
- <Compile Include="Views\Controls\AdvancedView.xaml.cs">
+ <Compile Include="Views\AdvancedView.xaml.cs">
<DependentUpon>AdvancedView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\Controls\AudioView.xaml.cs">
+ <Compile Include="Views\AudioView.xaml.cs">
<DependentUpon>AudioView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\Controls\ChaptersView.xaml.cs">
- <DependentUpon>ChaptersView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\AddPresetView.xaml.cs">
<DependentUpon>AddPresetView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\ChaptersView.xaml.cs">
+ <DependentUpon>ChaptersView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\FiltersView.xaml.cs">
+ <DependentUpon>FiltersView.xaml</DependentUpon>
+ </Compile>
+ <Compile Include="Views\SubtitlesView.xaml.cs">
+ <DependentUpon>SubtitlesView.xaml</DependentUpon>
+ </Compile>
<Compile Include="Views\ErrorView.xaml.cs">
<DependentUpon>ErrorView.xaml</DependentUpon>
</Compile>
@@ -143,15 +163,15 @@
<Compile Include="Views\MainView.xaml.cs">
<DependentUpon>MainView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\Controls\PictureSettingsView.xaml.cs">
+ <Compile Include="Views\PictureSettingsView.xaml.cs">
<DependentUpon>PictureSettingsView.xaml</DependentUpon>
</Compile>
- <Compile Include="Views\Controls\SubtitlesView.xaml.cs">
- <DependentUpon>SubtitlesView.xaml</DependentUpon>
- </Compile>
<Compile Include="Views\OptionsView.xaml.cs">
<DependentUpon>OptionsView.xaml</DependentUpon>
</Compile>
+ <Compile Include="Views\VideoView.xaml.cs">
+ <DependentUpon>VideoView.xaml</DependentUpon>
+ </Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
@@ -183,19 +203,27 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\Controls\AdvancedView.xaml">
+ <Page Include="Views\AdvancedView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\Controls\AudioView.xaml">
+ <Page Include="Views\AudioView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\Controls\ChaptersView.xaml">
+ <Page Include="Views\AddPresetView.xaml">
+ <Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
+ </Page>
+ <Page Include="Views\ChaptersView.xaml">
<Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
</Page>
- <Page Include="Views\AddPresetView.xaml">
+ <Page Include="Views\FiltersView.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
+ <Page Include="Views\SubtitlesView.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
@@ -219,15 +247,15 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\Controls\PictureSettingsView.xaml">
+ <Page Include="Views\PictureSettingsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\Controls\SubtitlesView.xaml">
+ <Page Include="Views\OptionsView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
- <Page Include="Views\OptionsView.xaml">
+ <Page Include="Views\VideoView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
diff --git a/win/CS/HandBrakeWPF/README BEFORE WRITING CODE.txt b/win/CS/HandBrakeWPF/README BEFORE WRITING CODE.txt
new file mode 100644
index 000000000..252bae71b
--- /dev/null
+++ b/win/CS/HandBrakeWPF/README BEFORE WRITING CODE.txt
@@ -0,0 +1,7 @@
+This is the port of the current WinForms GUI over to WPF.
+It is an incomplete work-in-progress and not currently in a usable state!
+
+Goals:
+
+- Move as much of the busness logic into the ApplicaitonServices library so it's reusable.
+- Rebuild the UI in WPF using MVVM approach using Caliburn Micro 1.2 as the base and Castle Windsor for IoC/DI \ No newline at end of file
diff --git a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
index 8c2e05d93..2fe913baa 100644
--- a/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
+++ b/win/CS/HandBrakeWPF/Startup/CastleBootstrapper.cs
@@ -62,6 +62,15 @@ namespace HandBrakeWPF.Startup
this.windsorContainer.Register(Component.For<IAboutViewModel>().ImplementedBy<AboutViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IOptionsViewModel>().ImplementedBy<OptionsViewModel>().LifeStyle.Is(LifestyleType.Singleton));
this.windsorContainer.Register(Component.For<IUpdateVersionService>().ImplementedBy<UpdateVersionService>().LifeStyle.Is(LifestyleType.Singleton));
+
+ // Tab Components
+ this.windsorContainer.Register(Component.For<IAudioViewModel>().ImplementedBy<AudioViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IAdvancedViewModel>().ImplementedBy<AdvancedViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IPictureSettingsViewModel>().ImplementedBy<PictureSettingsViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IChaptersViewModel>().ImplementedBy<ChaptersViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<ISubtitlesViewModel>().ImplementedBy<SubtitlesViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IFiltersViewModel>().ImplementedBy<FiltersViewModel>().LifeStyle.Is(LifestyleType.Singleton));
+ this.windsorContainer.Register(Component.For<IVideoViewModel>().ImplementedBy<VideoViewModel>().LifeStyle.Is(LifestyleType.Singleton));
}
/// <summary>
diff --git a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
index c300487e3..e506fb987 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AboutViewModel.cs
@@ -25,11 +25,6 @@ namespace HandBrakeWPF.ViewModels
public class AboutViewModel : ViewModelBase, IAboutViewModel
{
/// <summary>
- /// Backing Field for the User setting service.
- /// </summary>
- private readonly IUserSettingService userSettingService;
-
- /// <summary>
/// Initializes a new instance of the <see cref="AboutViewModel"/> class.
/// </summary>
/// <param name="windowManager">
@@ -39,9 +34,7 @@ namespace HandBrakeWPF.ViewModels
/// The user Setting Service.
/// </param>
public AboutViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
- : base(windowManager)
{
- this.userSettingService = userSettingService;
this.Title = "About HandBrake";
}
@@ -52,11 +45,11 @@ namespace HandBrakeWPF.ViewModels
{
get
{
- string nightly = userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;
+ string nightly = UserSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion).Contains("svn") ? " (SVN / Nightly Build)" : string.Empty;
return string.Format(
"{0} ({1}) {2}",
- userSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
- userSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild),
+ UserSettingService.GetUserSetting<string>(ASUserSettingConstants.HandBrakeVersion),
+ UserSettingService.GetUserSetting<int>(ASUserSettingConstants.HandBrakeBuild),
nightly);
}
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
index d4a6f077c..c46792c7c 100644
--- a/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/AddPresetViewModel.cs
@@ -7,18 +7,20 @@
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-using System.Windows;
-using HandBrake.ApplicationServices.Model;
-using HandBrake.ApplicationServices.Services.Interfaces;
-using HandBrake.ApplicationServices.Utilities;
-using HandBrakeWPF.Services.Interfaces;
-
namespace HandBrakeWPF.ViewModels
{
using System.ComponentModel.Composition;
- using Interfaces;
+ using System.Windows;
+
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Model;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+ using HandBrake.ApplicationServices.Utilities;
+
+ using HandBrakeWPF.Services.Interfaces;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
/// <summary>
/// The Add Preset View Model
/// </summary>
@@ -47,7 +49,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="errorService">
/// The Error Service
/// </param>
- public AddPresetViewModel(IWindowManager windowManager, IPresetService presetService, IErrorService errorService) : base(windowManager)
+ public AddPresetViewModel(IWindowManager windowManager, IPresetService presetService, IErrorService errorService)
{
this.presetService = presetService;
this.errorService = errorService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
new file mode 100644
index 000000000..9b50acc5c
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/AdvancedViewModel.cs
@@ -0,0 +1,44 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AdvancedViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Advanced View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Advanced View Model
+ /// </summary>
+ [Export(typeof(IAdvancedViewModel))]
+ public class AdvancedViewModel : ViewModelBase, IAdvancedViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AdvancedViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public AdvancedViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ }
+
+ /// <summary>
+ /// Gets or sets State.
+ /// </summary>
+ public string Query { get; set; }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
new file mode 100644
index 000000000..d8e4c194d
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/AudioViewModel.cs
@@ -0,0 +1,62 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Audio View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.Collections.ObjectModel;
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Audio View Model
+ /// </summary>
+ [Export(typeof(IAudioViewModel))]
+ public class AudioViewModel : ViewModelBase, IAudioViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public AudioViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ this.AudioTracks = new ObservableCollection<AudioTrack>();
+ }
+
+ /// <summary>
+ /// Gets or sets AudioTracks.
+ /// </summary>
+ public ObservableCollection<AudioTrack> AudioTracks { get; set; }
+
+ /// <summary>
+ /// Add an Audio Track
+ /// </summary>
+ public void Add()
+ {
+ this.AudioTracks.Add(new AudioTrack());
+ }
+
+ /// <summary>
+ /// Remove the Selected Track
+ /// </summary>
+ public void Remove()
+ {
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
index 247378875..672082b51 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ChaptersViewModel.cs
@@ -1,31 +1,36 @@
// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="ChaptersView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
+// <copyright file="ChaptersViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
// </copyright>
// <summary>
-// Interaction logic for ChaptersView.xaml
+// The Chapters View Model
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrakeWPF.Views.Controls
+namespace HandBrakeWPF.ViewModels
{
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
+ using System.ComponentModel.Composition;
using System.IO;
- using System.Windows;
- using System.Windows.Controls;
+
+ using Caliburn.Micro;
using HandBrake.ApplicationServices.Exceptions;
using HandBrake.ApplicationServices.Model.Encoding;
using HandBrake.ApplicationServices.Parsing;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
using Ookii.Dialogs.Wpf;
/// <summary>
- /// Interaction logic for ChaptersView.xaml
+ /// The Chapters View Model
/// </summary>
- public partial class ChaptersView : UserControl
+ [Export(typeof(IChaptersViewModel))]
+ public class ChaptersViewModel : ViewModelBase, IChaptersViewModel
{
/// <summary>
/// Gets or sets SourceChapterList.
@@ -33,41 +38,28 @@ namespace HandBrakeWPF.Views.Controls
private ObservableCollection<Chapter> SourceChapterList { get; set; }
/// <summary>
- /// Initializes a new instance of the <see cref="ChaptersView"/> class.
+ /// Initializes a new instance of the <see cref="ChaptersViewModel"/> class.
/// </summary>
- public ChaptersView()
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public ChaptersViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
{
- InitializeComponent();
- this.SourceChapterList = new ObservableCollection<Chapter>();
+ this.Chapters = new ObservableCollection<ChapterMarker>();
}
/// <summary>
- /// The "Chapters" Dependancy Property
- /// </summary>
- 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 ObservableCollection<ChapterMarker> Chapters
- {
- get { return (ObservableCollection<ChapterMarker>)this.GetValue(ChaptersProperty); }
- set { this.SetValue(ChaptersProperty, value); }
- }
+ public ObservableCollection<ChapterMarker> Chapters { get; set; }
/// <summary>
/// Gets or sets a value indicating whether chapter markers are enabled.
/// </summary>
- public bool IncludeChapterMarkers
- {
- get { return (bool)this.GetValue(IncludeChaptersProperty); }
- set { this.SetValue(IncludeChaptersProperty, value); }
- }
+ public bool IncludeChapterMarkers { get; set; }
/// <summary>
/// Set the Source Chapters List
@@ -125,13 +117,7 @@ namespace HandBrakeWPF.Views.Controls
/// <summary>
/// Import a CSV file
/// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The RoutedEventArgs.
- /// </param>
- private void Import_Click(object sender, RoutedEventArgs e)
+ private void Import()
{
VistaOpenFileDialog dialog = new VistaOpenFileDialog { Filter = "CSV files (*.csv)|*.csv", CheckFileExists = true };
dialog.ShowDialog();
@@ -178,13 +164,7 @@ namespace HandBrakeWPF.Views.Controls
/// <summary>
/// Export a CSV file.
/// </summary>
- /// <param name="sender">
- /// The sender.
- /// </param>
- /// <param name="e">
- /// The RoutedEventArgs.
- /// </param>
- private void Export_Click(object sender, RoutedEventArgs e)
+ private void Export()
{
VistaSaveFileDialog saveFileDialog = new VistaSaveFileDialog { Filter = "Csv File|*.csv", DefaultExt = "csv", CheckPathExists = true };
saveFileDialog.ShowDialog();
diff --git a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
index b93671970..bed8806a4 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ErrorViewModel.cs
@@ -46,7 +46,6 @@ namespace HandBrakeWPF.ViewModels
/// Initializes a new instance of the <see cref="ErrorViewModel"/> class.
/// </summary>
public ErrorViewModel()
- : base(null)
{
this.Title = "Error";
this.ErrorMessage = "An Unknown Error has occured.";
diff --git a/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
new file mode 100644
index 000000000..571606e1d
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/FiltersViewModel.cs
@@ -0,0 +1,39 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="FiltersViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Filters View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Filters View Model
+ /// </summary>
+ [Export(typeof(IFiltersViewModel))]
+ public class FiltersViewModel : ViewModelBase, IFiltersViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="FiltersViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public FiltersViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
new file mode 100644
index 000000000..1ffb86c96
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAdvancedViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IAdvancedViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IAdvancedViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Advanced View Model Interface
+ /// </summary>
+ public interface IAdvancedViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs
new file mode 100644
index 000000000..bd13345db
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IAudioViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IAudioViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IAudioViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Audio View Model Interface
+ /// </summary>
+ public interface IAudioViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs
new file mode 100644
index 000000000..8e9710d74
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IChaptersViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IChaptersViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IChaptersViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Chapters View Model Interface
+ /// </summary>
+ public interface IChaptersViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IErrorViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IErrorViewModel.cs
index a0fa8e36d..6094157b0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IErrorViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IErrorViewModel.cs
@@ -15,17 +15,17 @@ namespace HandBrakeWPF.ViewModels.Interfaces
public interface IErrorViewModel
{
/// <summary>
- /// The Error Details
+ /// Sets Details.
/// </summary>
string Details { set; }
/// <summary>
- /// The Error Message
+ /// Sets ErrorMessage.
/// </summary>
string ErrorMessage { set; }
/// <summary>
- /// The Error Solution
+ /// Sets Solution.
/// </summary>
string Solution { set; }
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs
new file mode 100644
index 000000000..24662f946
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IFiltersViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IFiltersViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IFiltersViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Filters View Model Interface
+ /// </summary>
+ public interface IFiltersViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs
new file mode 100644
index 000000000..35a8e4eaf
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IPictureSettingsViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IPictureSettingsViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IPictureSettingsViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Picture Settings View Model Interface
+ /// </summary>
+ public interface IPictureSettingsViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs
new file mode 100644
index 000000000..2a490c274
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/ISubtitlesViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ISubtitlesViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the ISubtitlesViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Subtiles View Model Interface
+ /// </summary>
+ public interface ISubtitlesViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
new file mode 100644
index 000000000..7690b87a9
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/Interfaces/IVideoViewModel.cs
@@ -0,0 +1,18 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="IVideoViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Defines the IVideoViewModel type.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels.Interfaces
+{
+ /// <summary>
+ /// The Video View Model Interface
+ /// </summary>
+ public interface IVideoViewModel
+ {
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
index aeba8e32e..8733445fd 100644
--- a/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/LogViewModel.cs
@@ -69,7 +69,6 @@ namespace HandBrakeWPF.ViewModels
/// The scan service.
/// </param>
public LogViewModel(IWindowManager windowManager, IEncode encodeService, IScan scanService)
- : base(windowManager)
{
this.encodeService = encodeService;
this.scanService = scanService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
index d742eea5c..daf8bcce0 100644
--- a/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/MainViewModel.cs
@@ -42,11 +42,6 @@ namespace HandBrakeWPF.ViewModels
#region Private Variables and Services
/// <summary>
- /// The Backing field for the user setting service.
- /// </summary>
- private readonly IUserSettingService userSettingService;
-
- /// <summary>
/// The Source Scan Service.
/// </summary>
private readonly IScan scanService;
@@ -153,9 +148,7 @@ namespace HandBrakeWPF.ViewModels
[ImportingConstructor]
public MainViewModel(IWindowManager windowManager, IUserSettingService userSettingService, IScan scanService, IEncode encodeService, IPresetService presetService,
IErrorService errorService)
- : base(windowManager)
{
- this.userSettingService = userSettingService;
this.scanService = scanService;
this.encodeService = encodeService;
this.presetService = presetService;
@@ -178,6 +171,44 @@ namespace HandBrakeWPF.ViewModels
this.queueProcessor.EncodeService.EncodeStatusChanged += this.EncodeStatusChanged;
}
+ #region View Model Properties
+ /// <summary>
+ /// Gets or sets PictureSettingsViewModel.
+ /// </summary>
+ public IPictureSettingsViewModel PictureSettingsViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets AudioViewModel.
+ /// </summary>
+ public IAudioViewModel AudioViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets SubtitleViewModel.
+ /// </summary>
+ public ISubtitlesViewModel SubtitleViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets ChaptersViewModel.
+ /// </summary>
+ public IChaptersViewModel ChaptersViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets AdvancedViewModel.
+ /// </summary>
+ public IAdvancedViewModel AdvancedViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets VideoViewModel.
+ /// </summary>
+ public IVideoViewModel VideoViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets FiltersViewModel.
+ /// </summary>
+ public IFiltersViewModel FiltersViewModel { get; set; }
+
+ #endregion
+
#region Properties
/// <summary>
/// Gets or sets TestProperty.
@@ -934,7 +965,7 @@ namespace HandBrakeWPF.ViewModels
// TODO
// 1. Disable GUI.
this.sourcePath = filename;
- this.scanService.Scan(filename, title, this.userSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount));
+ this.scanService.Scan(filename, title, this.UserSettingService.GetUserSetting<int>(ASUserSettingConstants.PreviewScanCount));
}
/// <summary>
@@ -948,7 +979,7 @@ namespace HandBrakeWPF.ViewModels
// Make sure the output extension is set correctly based on the users preferences and selection.
if (newExtension == ".mp4" || newExtension == ".m4v")
{
- switch (this.userSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v))
+ switch (this.UserSettingService.GetUserSetting<int>(UserSettingConstants.UseM4v))
{
case 0: // Auto
newExtension = this.CurrentTask.RequiresM4v ? ".m4v" : ".mp4";
diff --git a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
index 4d11f6786..1f5802503 100644
--- a/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/OptionsViewModel.cs
@@ -318,10 +318,9 @@ namespace HandBrakeWPF.ViewModels
/// The user Setting Service.
/// </param>
public OptionsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
- : base(windowManager)
{
this.Title = "Options";
- this.userSettingService = userSettingService;
+ this.userSettingService = this.UserSettingService;
this.Load();
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
new file mode 100644
index 000000000..60c6feb09
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/PictureSettingsViewModel.cs
@@ -0,0 +1,39 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PictureSettingsViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Picture Settings View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Picture Settings View Model
+ /// </summary>
+ [Export(typeof(IPictureSettingsViewModel))]
+ public class PictureSettingsViewModel : ViewModelBase, IPictureSettingsViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.PictureSettingsViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public PictureSettingsViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs
index e7fd8f098..0f9c7a213 100644
--- a/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/PreviewViewModel.cs
@@ -23,7 +23,7 @@ namespace HandBrakeWPF.ViewModels
/// <param name="windowManager">
/// The window manager.
/// </param>
- public PreviewViewModel(IWindowManager windowManager) : base(windowManager)
+ public PreviewViewModel(IWindowManager windowManager)
{
this.Title = "Preview";
}
diff --git a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
index e651d9830..060d9ec38 100644
--- a/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/QueueViewModel.cs
@@ -65,7 +65,6 @@ namespace HandBrakeWPF.ViewModels
/// The Error Service
/// </param>
public QueueViewModel(IWindowManager windowManager, IQueueProcessor queueProcessor, IErrorService errorService)
- : base(windowManager)
{
this.queueProcessor = queueProcessor;
this.errorService = errorService;
diff --git a/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
new file mode 100644
index 000000000..d57f19fb9
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/SubtitlesViewModel.cs
@@ -0,0 +1,72 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitlesViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Subtitles View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System;
+ using System.Collections.ObjectModel;
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Model.Encoding;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Subtitles View Model
+ /// </summary>
+ [Export(typeof(ISubtitlesViewModel))]
+ public class SubtitlesViewModel : ViewModelBase, ISubtitlesViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="HandBrakeWPF.ViewModels.SubtitlesViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public SubtitlesViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ this.SubtitleTracks = new ObservableCollection<SubtitleTrack>();
+ }
+
+ /// <summary>
+ /// Gets or sets State.
+ /// </summary>
+ public ObservableCollection<SubtitleTrack> SubtitleTracks { get; set; }
+
+ /// <summary>
+ /// Add a new Track
+ /// </summary>
+ public void Add()
+ {
+ this.SubtitleTracks.Add(new SubtitleTrack());
+ }
+
+ /// <summary>
+ /// Remove a Track
+ /// </summary>
+ public void Remove()
+ {
+ throw new NotImplementedException();
+ }
+
+ /// <summary>
+ /// Import an SRT File.
+ /// </summary>
+ public void Import()
+ {
+ throw new NotImplementedException();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
new file mode 100644
index 000000000..59b6a98f5
--- /dev/null
+++ b/win/CS/HandBrakeWPF/ViewModels/VideoViewModel.cs
@@ -0,0 +1,39 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="VideoViewModel.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// The Video View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.ComponentModel.Composition;
+
+ using Caliburn.Micro;
+
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Video View Model
+ /// </summary>
+ [Export(typeof(IVideoViewModel))]
+ public class VideoViewModel : ViewModelBase, IVideoViewModel
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="VideoViewModel"/> class.
+ /// </summary>
+ /// <param name="windowManager">
+ /// The window manager.
+ /// </param>
+ /// <param name="userSettingService">
+ /// The user Setting Service.
+ /// </param>
+ public VideoViewModel(IWindowManager windowManager, IUserSettingService userSettingService)
+ {
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
index e226fc549..f1766741e 100644
--- a/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
+++ b/win/CS/HandBrakeWPF/ViewModels/ViewModelBase.cs
@@ -11,6 +11,8 @@ namespace HandBrakeWPF.ViewModels
{
using Caliburn.Micro;
+ using HandBrake.ApplicationServices.Services.Interfaces;
+
using HandBrakeWPF.ViewModels.Interfaces;
/// <summary>
@@ -37,12 +39,8 @@ namespace HandBrakeWPF.ViewModels
/// <summary>
/// Initializes a new instance of the <see cref="ViewModelBase"/> class.
/// </summary>
- /// <param name="windowManager">
- /// The window manager.
- /// </param>
- public ViewModelBase(IWindowManager windowManager)
+ public ViewModelBase()
{
- this.WindowManager = windowManager;
}
#endregion
@@ -67,9 +65,14 @@ namespace HandBrakeWPF.ViewModels
}
/// <summary>
- /// Gets WindowManager.
+ /// Gets or sets WindowManager.
+ /// </summary>
+ public IWindowManager WindowManager { get; set; }
+
+ /// <summary>
+ /// Gets or sets UserSettingService.
/// </summary>
- public IWindowManager WindowManager { get; private set; }
+ public IUserSettingService UserSettingService { get; set; }
#endregion
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
index 0eeaff7e8..ce91077ba 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml
@@ -1,4 +1,4 @@
-<UserControl x:Class="HandBrakeWPF.Views.Controls.AdvancedView"
+<UserControl x:Class="HandBrakeWPF.Views.AdvancedView"
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"
@@ -15,7 +15,7 @@
<TextBlock Text="Advanced" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
- <TextBox Grid.Row="2" Margin="10" Text="{Binding Query, RelativeSource={RelativeSource AncestorType=UserControl}}"
+ <TextBox Grid.Row="2" Margin="10" Text="{Binding Query}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
</Grid>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs
index f00d972bb..a47bf3efd 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AdvancedView.xaml.cs
+++ b/win/CS/HandBrakeWPF/Views/AdvancedView.xaml.cs
@@ -7,9 +7,8 @@
// </summary>
// --------------------------------------------------------------------------------------------------------------------
-namespace HandBrakeWPF.Views.Controls
+namespace HandBrakeWPF.Views
{
- using System.Windows;
using System.Windows.Controls;
/// <summary>
@@ -24,26 +23,5 @@ namespace HandBrakeWPF.Views.Controls
{
InitializeComponent();
}
-
- /// <summary>
- /// The "Query" Dependancy Property
- /// </summary>
- 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);
- }
- }
}
}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml b/win/CS/HandBrakeWPF/Views/AudioView.xaml
index 161546a41..84616338b 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml
@@ -1,4 +1,4 @@
-<UserControl x:Class="HandBrakeWPF.Views.Controls.AudioView"
+<UserControl x:Class="HandBrakeWPF.Views.AudioView"
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"
@@ -21,11 +21,11 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <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" />
+ <Button Content="Add Track" cal:Message.Attach="[Event Click] = [Action Add]" Grid.Column="0" Width="75" Margin="0,0,10,0" />
+ <Button Content="Remove" cal:Message.Attach="[Event Click] = [Action Remove]" Grid.Column="1" Width="75" />
</Grid>
- <ListBox Grid.Row="2" ItemsSource="{Binding AudioTracks, RelativeSource={RelativeSource AncestorType=UserControl}}"
+ <ListBox Grid.Row="2" ItemsSource="{Binding AudioTracks}"
SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
@@ -44,7 +44,7 @@
</Grid.ColumnDefinitions>
<!-- Marker -->
- <Image Source="../Images/Movies.png" Width="16" Height="16" Grid.Column="0" Margin="10,0,10,0" />
+ <Image Source="Images/Movies.png" Width="16" Height="16" Grid.Column="0" Margin="10,0,10,0" />
<!-- Settings -->
<Grid Grid.Column="1" HorizontalAlignment="Stretch">
@@ -89,7 +89,7 @@
</Grid>
<!-- Delete -->
- <Image Source="../Images/delete.png" Width="16" Height="16" Grid.Column="2" Margin="10,0,10,0">
+ <Image Source="Images/delete.png" Width="16" Height="16" Grid.Column="2" Margin="10,0,10,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<cal:ActionMessage MethodName="RemoveJob">
diff --git a/win/CS/HandBrakeWPF/Views/AudioView.xaml.cs b/win/CS/HandBrakeWPF/Views/AudioView.xaml.cs
new file mode 100644
index 000000000..0dc1dc9b8
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/AudioView.xaml.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="AudioView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Interaction logic for AudioView.xaml
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for AudioView.xaml
+ /// </summary>
+ public partial class AudioView : UserControl
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="AudioView"/> class.
+ /// </summary>
+ public AudioView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml
index 1f905065d..9166dcf80 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/ChaptersView.xaml
+++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml
@@ -1,8 +1,8 @@
-<UserControl x:Class="HandBrakeWPF.Views.Controls.ChaptersView"
+<UserControl x:Class="HandBrakeWPF.Views.ChaptersView"
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>
@@ -20,12 +20,12 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <CheckBox Content="Create chapter markers" IsChecked="{Binding IncludeChapterMarkers, RelativeSource={RelativeSource AncestorType=UserControl}}" Grid.Column="0" VerticalAlignment="Center" />
- <Button Content="Import" Name="import" Grid.Column="2" Width="75" Margin="0,0,10,0" Click="Import_Click" />
- <Button Content="Export" Name="export" Grid.Column="3" Width="75" Click="Export_Click" />
+ <CheckBox Content="Create chapter markers" IsChecked="{Binding IncludeChapterMarkers}" Grid.Column="0" VerticalAlignment="Center" />
+ <Button Content="Import" Name="import" Grid.Column="2" Width="75" Margin="0,0,10,0" cal:Message.Attach="[Event Click] = [Action Import]" />
+ <Button Content="Export" Name="export" Grid.Column="3" Width="75" cal:Message.Attach="[Event Click] = [Action Export]" />
</Grid>
- <DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding Chapters, RelativeSource={RelativeSource AncestorType=UserControl}}"
+ <DataGrid Grid.Row="2" Margin="10" ItemsSource="{Binding Chapters}"
VerticalAlignment="Stretch" HorizontalAlignment="Stretch" AutoGenerateColumns="False"
CanUserSortColumns="False" CanUserReorderColumns="False" CanUserResizeColumns="False" CanUserResizeRows="False">
<DataGrid.Columns>
diff --git a/win/CS/HandBrakeWPF/Views/ChaptersView.xaml.cs b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml.cs
new file mode 100644
index 000000000..c53e4cbe5
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/ChaptersView.xaml.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ChaptersView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Interaction logic for ChaptersView.xaml
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for ChaptersView.xaml
+ /// </summary>
+ public partial class ChaptersView : UserControl
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ChaptersView"/> class.
+ /// </summary>
+ public ChaptersView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs
deleted file mode 100644
index 417a1226c..000000000
--- a/win/CS/HandBrakeWPF/Views/Controls/AudioView.xaml.cs
+++ /dev/null
@@ -1,75 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="AudioView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Interaction logic for AudioView.xaml
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Views.Controls
-{
- using System;
- using System.Collections.ObjectModel;
- using System.Windows;
- using System.Windows.Controls;
-
- using HandBrake.ApplicationServices.Model.Encoding;
-
- /// <summary>
- /// Interaction logic for AudioView.xaml
- /// </summary>
- public partial class AudioView : UserControl
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="AudioView"/> class.
- /// </summary>
- public AudioView()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// The "Query" Dependancy Property
- /// </summary>
- public static readonly DependencyProperty AudioTracksProperty = DependencyProperty.Register("AudioTracks", typeof(ObservableCollection<AudioTrack>), typeof(AudioView));
-
- /// <summary>
- /// Gets or sets State.
- /// </summary>
- public ObservableCollection<AudioTrack> AudioTracks
- {
- get { return (ObservableCollection<AudioTrack>)this.GetValue(AudioTracksProperty); }
- set { this.SetValue(AudioTracksProperty, 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.AudioTracks.Add(new AudioTrack());
- }
-
- /// <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();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml.cs
deleted file mode 100644
index c86e0f8e0..000000000
--- a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace HandBrakeWPF.Views.Controls
-{
- using System.Windows.Controls;
-
- /// <summary>
- /// Interaction logic for PictureSettingsView.xaml
- /// </summary>
- public partial class PictureSettingsView : UserControl
- {
- public PictureSettingsView()
- {
- InitializeComponent();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs b/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs
deleted file mode 100644
index 44922c1a6..000000000
--- a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml.cs
+++ /dev/null
@@ -1,88 +0,0 @@
-// --------------------------------------------------------------------------------------------------------------------
-// <copyright file="SubtitlesView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
-// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
-// </copyright>
-// <summary>
-// Interaction logic for SubtitlesView.xaml
-// </summary>
-// --------------------------------------------------------------------------------------------------------------------
-
-namespace HandBrakeWPF.Views.Controls
-{
- using System;
- using System.Collections.ObjectModel;
- using System.Windows;
- using System.Windows.Controls;
-
- using HandBrake.ApplicationServices.Model.Encoding;
-
- /// <summary>
- /// Interaction logic for SubtitlesView.xaml
- /// </summary>
- public partial class SubtitlesView : UserControl
- {
- /// <summary>
- /// Initializes a new instance of the <see cref="SubtitlesView"/> class.
- /// </summary>
- public SubtitlesView()
- {
- InitializeComponent();
- }
-
- /// <summary>
- /// The "Query" Dependancy Property
- /// </summary>
- public static readonly DependencyProperty SubtitleTracksProperty = DependencyProperty.Register("SubtitleTracks", typeof(ObservableCollection<SubtitleTrack>), typeof(SubtitlesView));
-
- /// <summary>
- /// Gets or sets State.
- /// </summary>
- public ObservableCollection<SubtitleTrack> SubtitleTracks
- {
- 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();
- }
- }
-}
diff --git a/win/CS/HandBrakeWPF/Views/FiltersView.xaml b/win/CS/HandBrakeWPF/Views/FiltersView.xaml
new file mode 100644
index 000000000..c472a84da
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/FiltersView.xaml
@@ -0,0 +1,58 @@
+<UserControl x:Class="HandBrakeWPF.Views.FiltersView"
+ 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"
+ mc:Ignorable="d" >
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+ <TextBlock Text="Filters" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
+
+ <StackPanel Orientation="Vertical" Grid.Row="1" Margin="10,10,0,0">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="Auto" />
+ </Grid.RowDefinitions>
+
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="100" />
+ <ColumnDefinition Width="130" />
+ <ColumnDefinition Width="Auto" />
+ </Grid.ColumnDefinitions>
+
+ <TextBlock Text="Detelecine:" Grid.Row="0" Grid.Column="0" Margin="0,0,0,10" />
+ <ComboBox Width="120" Grid.Row="0" Grid.Column="1" Margin="0,0,0,10"/>
+ <TextBox Width="120" Grid.Row="0" Grid.Column="2" Margin="0,0,0,10"/>
+
+ <TextBlock Text="Decomb:" Grid.Row="1" Grid.Column="0" Margin="0,0,0,10"/>
+ <ComboBox Width="120" Grid.Row="1" Grid.Column="1" Margin="0,0,0,10"/>
+ <TextBox Width="120" Grid.Row="1" Grid.Column="2" Margin="0,0,0,10"/>
+
+ <TextBlock Text="Deinterlace:" Grid.Row="2" Grid.Column="0" Margin="0,0,0,10"/>
+ <ComboBox Width="120" Grid.Row="2" Grid.Column="1" Margin="0,0,0,10"/>
+ <TextBox Width="120" Grid.Row="2" Grid.Column="2" Margin="0,0,0,10"/>
+
+ <TextBlock Text="Denoise:" Grid.Row="3" Grid.Column="0" Margin="0,0,0,10"/>
+ <ComboBox Width="120" Grid.Row="3" Grid.Column="1" Margin="0,0,0,10"/>
+ <TextBox Width="120" Grid.Row="3" Grid.Column="2" Margin="0,0,0,10"/>
+
+ <TextBlock Text="Deblock:" Grid.Row="4" Grid.Column="0" Margin="0,0,0,10"/>
+ <Slider Width="120" Grid.Row="4" Grid.Column="1" Margin="0,0,0,10"/>
+ <TextBlock Text="Off" Grid.Row="4" Grid.Column="2" Margin="0,0,0,10"/>
+
+ <CheckBox Content="Grayscale" Grid.Row="5" Grid.Column="1" Margin="0,0,0,10"/>
+ </Grid>
+
+ </StackPanel>
+
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/FiltersView.xaml.cs b/win/CS/HandBrakeWPF/Views/FiltersView.xaml.cs
new file mode 100644
index 000000000..35e978b7f
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/FiltersView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace HandBrakeWPF.Views
+{
+ /// <summary>
+ /// Interaction logic for FiltersView.xaml
+ /// </summary>
+ public partial class FiltersView : UserControl
+ {
+ public FiltersView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/MainView.xaml b/win/CS/HandBrakeWPF/Views/MainView.xaml
index 4fb29ae7c..a92948ce2 100644
--- a/win/CS/HandBrakeWPF/Views/MainView.xaml
+++ b/win/CS/HandBrakeWPF/Views/MainView.xaml
@@ -2,7 +2,7 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Data="clr-namespace:System.Windows.Data;assembly=PresentationFramework"
xmlns:Converters="clr-namespace:HandBrakeWPF.Converters"
- xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro" xmlns:Controls="clr-namespace:HandBrakeWPF.Views.Controls"
+ xmlns:Micro="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
Title="{Data:Binding Path=WindowTitle}" Height="655" Width="1015" FontSize="11" Background="#FFF0F0F0">
<Window.Resources>
@@ -120,7 +120,7 @@
<Label Content="Preview" Margin="8,0,0,0" VerticalAlignment="Center" />
</StackPanel>
</Button>
-
+
<Button Name="ActivityWindow" Micro:Message.Attach="[Event Click] = [Action OpenLogWindow]">
<StackPanel Orientation="Horizontal">
<Image Source="Images/ActivityWindow.png" Height="32" Width="32" />
@@ -187,136 +187,25 @@
<!-- Tab Control -->
<TabControl HorizontalAlignment="Left" VerticalAlignment="Stretch" Width="725" Height="330" Margin="10,10,10,10" Name="tabControl" >
<TabItem Header="Picture" Name="pictureTab">
- <Controls:PictureSettingsView x:Name="pictureSettingsView"></Controls:PictureSettingsView>
+ <ContentControl x:Name="PictureSettingsViewModel" ></ContentControl>
</TabItem>
<TabItem Header="Video Filters" Name="filtersTab">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
- <TextBlock Text="Filters" FontWeight="Bold" Margin="10,5,0,0" Grid.Row="0" ></TextBlock>
-
- <StackPanel Orientation="Vertical" Grid.Row="1" Margin="10,10,0,0">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- <RowDefinition Height="Auto" />
- </Grid.RowDefinitions>
-
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="100" />
- <ColumnDefinition Width="130" />
- <ColumnDefinition Width="Auto" />
- </Grid.ColumnDefinitions>
-
- <TextBlock Text="Detelecine:" Grid.Row="0" Grid.Column="0" Margin="0,0,0,10" />
- <ComboBox Width="120" Grid.Row="0" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="0" Grid.Column="2" Margin="0,0,0,10"/>
-
- <TextBlock Text="Decomb:" Grid.Row="1" Grid.Column="0" Margin="0,0,0,10"/>
- <ComboBox Width="120" Grid.Row="1" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="1" Grid.Column="2" Margin="0,0,0,10"/>
-
- <TextBlock Text="Deinterlace:" Grid.Row="2" Grid.Column="0" Margin="0,0,0,10"/>
- <ComboBox Width="120" Grid.Row="2" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="2" Grid.Column="2" Margin="0,0,0,10"/>
-
- <TextBlock Text="Denoise:" Grid.Row="3" Grid.Column="0" Margin="0,0,0,10"/>
- <ComboBox Width="120" Grid.Row="3" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBox Width="120" Grid.Row="3" Grid.Column="2" Margin="0,0,0,10"/>
-
- <TextBlock Text="Deblock:" Grid.Row="4" Grid.Column="0" Margin="0,0,0,10"/>
- <Slider Width="120" Grid.Row="4" Grid.Column="1" Margin="0,0,0,10"/>
- <TextBlock Text="Off" Grid.Row="4" Grid.Column="2" Margin="0,0,0,10"/>
-
- <CheckBox Content="Grayscale" Grid.Row="5" Grid.Column="1" Margin="0,0,0,10"/>
- </Grid>
-
- </StackPanel>
-
- </Grid>
+ <ContentControl x:Name="FiltersViewModel" ></ContentControl>
</TabItem>
-
<TabItem Header="Video" Name="videoTab">
- <Grid Margin="10,5,0,0">
- <Grid.RowDefinitions>
- <RowDefinition Height="Auto" />
- <RowDefinition Height="*" />
- </Grid.RowDefinitions>
-
-
- <Grid Grid.Row="1">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
-
- <StackPanel Orientation="Vertical" Grid.Column="0" >
-
- <TextBlock Text="Video" FontWeight="Bold" Margin="0,0,0,10"/>
-
- <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
- <TextBlock Text="Video Codec:" Width="100" />
- <ComboBox Width="120"/>
- </StackPanel>
-
- <StackPanel Orientation="Horizontal">
- <TextBlock Text="Franerate (FPS):" Width="100"/>
- <StackPanel Orientation="Vertical">
- <ComboBox Width="120" />
- <RadioButton Content="Constant Framerate" />
- <RadioButton Content="Variable Framerate" />
- <RadioButton Content="Peak Framerate" />
- </StackPanel>
- </StackPanel>
- </StackPanel>
-
-
- <StackPanel Orientation="Vertical" Grid.Column="1" >
- <TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>
-
- <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
- <RadioButton Content="Constant Quality:" Margin="0,0,10,0"/>
- <TextBlock Text="0" Width="25" />
- <TextBlock Text="RF" FontWeight="Bold" />
- </StackPanel>
-
- <Slider Width="240" Margin="0,0,0,20" />
-
- <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
- <RadioButton Content="Avg Bitrate (kbps):" Margin="0,0,10,0"/>
- <TextBox Width="75" />
- </StackPanel>
-
- <StackPanel Orientation="Horizontal" Margin="30,0,0,0">
- <CheckBox Content="2-Pass Encoding" Margin="0,0,10,0" />
- <CheckBox Content="Turbo first pass" />
- </StackPanel>
-
- </StackPanel>
-
-
- </Grid>
-
- </Grid>
+ <ContentControl x:Name="VideoViewModel" ></ContentControl>
</TabItem>
<TabItem Header="Audio" Name="audioTab">
- <Controls:AudioView AudioTracks="{Binding CurrentTask.AudioTracks, Mode=TwoWay}"></Controls:AudioView>
+ <ContentControl x:Name="AudioViewModel" ></ContentControl>
</TabItem>
<TabItem Header="Subtitles" Name="subtitlesTab">
- <Controls:SubtitlesView SubtitleTracks="{Binding CurrentTask.SubtitleTracks, Mode=TwoWay}"></Controls:SubtitlesView>
+ <ContentControl x:Name="SubtitleViewModel"></ContentControl>
</TabItem>
<TabItem Header="Chapters" Name="chaptersTab">
- <Controls:ChaptersView IncludeChapterMarkers="{Binding CurrentTask.IncludeChapterMarkers, Mode=TwoWay}" Chapters="{Binding CurrentTask.ChapterNames, Mode=TwoWay}"></Controls:ChaptersView>
+ <ContentControl x:Name="ChaptersViewModel"></ContentControl>
</TabItem>
<TabItem Header="Advanced" Name="advancedTab">
- <Controls:AdvancedView Query="{Binding CurrentTask.AdvancedEncoderOptions, Mode=TwoWay}"></Controls:AdvancedView>
+ <ContentControl x:Name="AdvancedViewModel"></ContentControl>
</TabItem>
</TabControl>
@@ -368,8 +257,8 @@
<MenuItem Header="Reset Built-in Presets" Micro:Message.Attach="[Event Click] = [Action PresetReset]" />
</MenuItem>
</Menu>
-
-
+
+
</ToolBar>
</StackPanel>
</GroupBox>
diff --git a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
index 0cb59f301..4bc306ddf 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/PictureSettingsView.xaml
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml
@@ -1,4 +1,4 @@
-<UserControl x:Class="HandBrakeWPF.Views.Controls.PictureSettingsView"
+<UserControl x:Class="HandBrakeWPF.Views.PictureSettingsView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:NumericUpDown="clr-namespace:EagleBoost.Wpf.Presentation.Controls.NumericUpDown;assembly=EagleBoost.Wpf.Presentation">
diff --git a/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml.cs b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml.cs
new file mode 100644
index 000000000..1d874d760
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/PictureSettingsView.xaml.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="PictureSettingsView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Interaction logic for PictureSettingsView.xaml
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for PictureSettingsView.xaml
+ /// </summary>
+ public partial class PictureSettingsView : UserControl
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="PictureSettingsView"/> class.
+ /// </summary>
+ public PictureSettingsView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
index 19c195e5d..4b2d9b61a 100644
--- a/win/CS/HandBrakeWPF/Views/Controls/SubtitlesView.xaml
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml
@@ -1,4 +1,4 @@
-<UserControl x:Class="HandBrakeWPF.Views.Controls.SubtitlesView"
+<UserControl x:Class="HandBrakeWPF.Views.SubtitlesView"
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"
@@ -21,12 +21,12 @@
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
- <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" />
+ <Button Content="Add" Name="AddTrack" Grid.Column="0" Width="75" Margin="0,0,10,0" cal:Message.Attach="[Event Click] = [Action Add]" />
+ <Button Content="Remove" Name="RemoveTrack" Grid.Column="1" Width="75" Margin="0,0,10,0" cal:Message.Attach="[Event Click] = [Action Remove]" />
+ <Button Content="Import SRT" Grid.Column="2" Width="75" cal:Message.Attach="[Event Click] = [Action Import]" />
</Grid>
- <ListBox Grid.Row="2" ItemsSource="{Binding SubtitleTracks, RelativeSource={RelativeSource AncestorType=UserControl}}"
+ <ListBox Grid.Row="2" ItemsSource="{Binding SubtitleTracks}"
SelectionMode="Extended" Background="LightGray" Margin="10,10,10,10">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
@@ -45,7 +45,7 @@
</Grid.ColumnDefinitions>
<!-- Marker -->
- <Image Source="../Images/Movies.png" Width="16" Height="16" Grid.Column="0" Margin="10,0,10,0" />
+ <Image Source="Images/Movies.png" Width="16" Height="16" Grid.Column="0" Margin="10,0,10,0" />
<!-- Settings -->
<Grid Grid.Column="1" HorizontalAlignment="Stretch">
@@ -90,7 +90,7 @@
</Grid>
<!-- Delete -->
- <Image Source="../Images/delete.png" Width="16" Height="16" Grid.Column="2" Margin="10,0,10,0">
+ <Image Source="Images/delete.png" Width="16" Height="16" Grid.Column="2" Margin="10,0,10,0">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDown">
<cal:ActionMessage MethodName="RemoveJob">
diff --git a/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml.cs b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml.cs
new file mode 100644
index 000000000..ea3e67114
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/SubtitlesView.xaml.cs
@@ -0,0 +1,27 @@
+// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="SubtitlesView.xaml.cs" company="HandBrake Project (http://handbrake.fr)">
+// This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License.
+// </copyright>
+// <summary>
+// Interaction logic for SubtitlesView.xaml
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Views
+{
+ using System.Windows.Controls;
+
+ /// <summary>
+ /// Interaction logic for SubtitlesView.xaml
+ /// </summary>
+ public partial class SubtitlesView : UserControl
+ {
+ /// <summary>
+ /// Initializes a new instance of the <see cref="SubtitlesView"/> class.
+ /// </summary>
+ public SubtitlesView()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml b/win/CS/HandBrakeWPF/Views/VideoView.xaml
new file mode 100644
index 000000000..d06255b71
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml
@@ -0,0 +1,68 @@
+<UserControl x:Class="HandBrakeWPF.Views.VideoView"
+ 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"
+ mc:Ignorable="d" >
+ <Grid Margin="10,5,0,0">
+ <Grid.RowDefinitions>
+ <RowDefinition Height="Auto" />
+ <RowDefinition Height="*" />
+ </Grid.RowDefinitions>
+
+
+ <Grid Grid.Row="1">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*" />
+ <ColumnDefinition Width="*" />
+ </Grid.ColumnDefinitions>
+
+ <StackPanel Orientation="Vertical" Grid.Column="0" >
+
+ <TextBlock Text="Video" FontWeight="Bold" Margin="0,0,0,10"/>
+
+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
+ <TextBlock Text="Video Codec:" Width="100" />
+ <ComboBox Width="120"/>
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Text="Franerate (FPS):" Width="100"/>
+ <StackPanel Orientation="Vertical">
+ <ComboBox Width="120" />
+ <RadioButton Content="Constant Framerate" />
+ <RadioButton Content="Variable Framerate" />
+ <RadioButton Content="Peak Framerate" />
+ </StackPanel>
+ </StackPanel>
+ </StackPanel>
+
+
+ <StackPanel Orientation="Vertical" Grid.Column="1" >
+ <TextBlock Text="Quality" FontWeight="Bold" Margin="0,0,0,10"/>
+
+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10" >
+ <RadioButton Content="Constant Quality:" Margin="0,0,10,0"/>
+ <TextBlock Text="0" Width="25" />
+ <TextBlock Text="RF" FontWeight="Bold" />
+ </StackPanel>
+
+ <Slider Width="240" Margin="0,0,0,20" />
+
+ <StackPanel Orientation="Horizontal" Margin="0,0,0,10">
+ <RadioButton Content="Avg Bitrate (kbps):" Margin="0,0,10,0"/>
+ <TextBox Width="75" />
+ </StackPanel>
+
+ <StackPanel Orientation="Horizontal" Margin="30,0,0,0">
+ <CheckBox Content="2-Pass Encoding" Margin="0,0,10,0" />
+ <CheckBox Content="Turbo first pass" />
+ </StackPanel>
+
+ </StackPanel>
+
+
+ </Grid>
+
+ </Grid>
+</UserControl>
diff --git a/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs b/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs
new file mode 100644
index 000000000..f59435f02
--- /dev/null
+++ b/win/CS/HandBrakeWPF/Views/VideoView.xaml.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace HandBrakeWPF.Views
+{
+ /// <summary>
+ /// Interaction logic for VideoView.xaml
+ /// </summary>
+ public partial class VideoView : UserControl
+ {
+ public VideoView()
+ {
+ InitializeComponent();
+ }
+ }
+}