diff options
author | sr55 <[email protected]> | 2012-06-08 02:13:59 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2012-06-08 02:13:59 +0000 |
commit | a03739f0457ad9211744e540f33ab8a3c05598b9 (patch) | |
tree | 2f0dda9a6f9e9c48b2bb58d9cc6462c77bd55715 /win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | |
parent | 368023e13a633e9dc94f27696c84f3ce3ca24ed3 (diff) |
WinGui: Added a Shell View which can host various windows. By default this will host the Main window. Changed the Options window to be a usercontrol so it can be hosted in this shell view, allowing for a chrome-esk style options within the main window without the need for a dialog window. The options window will need some design changes. (Coming soon)
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@4721 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs new file mode 100644 index 000000000..349dc1200 --- /dev/null +++ b/win/CS/HandBrakeWPF/ViewModels/ShellViewModel.cs @@ -0,0 +1,128 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="ShellViewModel.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 Shell View Model
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.ViewModels
+{
+ using System.ComponentModel.Composition;
+
+ using HandBrakeWPF.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// The Shell View Model
+ /// </summary>
+ [Export(typeof(IShellViewModel))]
+ public class ShellViewModel : ViewModelBase, IShellViewModel
+ {
+ #region Constants and Fields
+
+ /// <summary>
+ /// The show main window.
+ /// </summary>
+ private bool showMainWindow;
+
+ /// <summary>
+ /// The show options.
+ /// </summary>
+ private bool showOptions;
+
+ #endregion
+
+ /// <summary>
+ /// Initializes a new instance of the <see cref="ShellViewModel"/> class.
+ /// </summary>
+ public ShellViewModel()
+ {
+ this.showMainWindow = true;
+ this.showOptions = false;
+ }
+
+ /// <summary>
+ /// Change the page displayed on this window.
+ /// </summary>
+ /// <param name="window">
+ /// The window.
+ /// </param>
+ public void DisplayWindow(ShellWindow window)
+ {
+ if (window == ShellWindow.MainWindow)
+ {
+ this.ShowMainWindow = true;
+ this.ShowOptions = false;
+ }
+ else if (window == ShellWindow.OptionsWindow)
+ {
+ this.ShowOptions = true;
+ this.ShowMainWindow = false;
+ }
+ else
+ {
+ this.ShowMainWindow = true;
+ this.ShowOptions = false;
+ }
+ }
+
+ #region Properties
+
+ /// <summary>
+ /// Gets or sets MainViewModel.
+ /// </summary>
+ public IMainViewModel MainViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets OptionsViewModel.
+ /// </summary>
+ public IOptionsViewModel OptionsViewModel { get; set; }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowMainWindow.
+ /// </summary>
+ public bool ShowMainWindow
+ {
+ get
+ {
+ return this.showMainWindow;
+ }
+ set
+ {
+ this.showMainWindow = value;
+ this.NotifyOfPropertyChange(() => this.ShowMainWindow);
+ }
+ }
+
+ /// <summary>
+ /// Gets or sets a value indicating whether ShowOptions.
+ /// </summary>
+ public bool ShowOptions
+ {
+ get
+ {
+ return this.showOptions;
+ }
+ set
+ {
+ this.showOptions = value;
+ this.NotifyOfPropertyChange(() => this.ShowOptions);
+ }
+ }
+
+ /// <summary>
+ /// Gets WindowTitle.
+ /// </summary>
+ public string WindowTitle
+ {
+ get
+ {
+ return "HandBrake";
+ }
+ }
+
+ #endregion
+ }
+}
\ No newline at end of file |