diff options
author | sr55 <[email protected]> | 2013-01-13 17:51:42 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2013-01-13 17:51:42 +0000 |
commit | f3fcc49085f080ad5f075da4a87bbaff47f92572 (patch) | |
tree | 2b483848c6111e73958d4f69af03e790a8abadc3 /win/CS/HandBrakeWPF/Commands | |
parent | b62992bfb1623ae6c0930c41e00c2b150ea780d9 (diff) |
WinGui: Options screen refactoring.
Help -> Check for updates now takes the user to the options screen update tab.
Help -> About now takes the user to the options screen about tab. Saves popping up annoying window.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@5169 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrakeWPF/Commands')
-rw-r--r-- | win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs new file mode 100644 index 000000000..30a473d90 --- /dev/null +++ b/win/CS/HandBrakeWPF/Commands/OpenOptionsScreenCommand.cs @@ -0,0 +1,62 @@ +// --------------------------------------------------------------------------------------------------------------------
+// <copyright file="OpenOptionsScreen.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>
+// A Command to display the options window.
+// </summary>
+// --------------------------------------------------------------------------------------------------------------------
+
+namespace HandBrakeWPF.Commands
+{
+ using System;
+ using System.Windows.Input;
+
+ using Caliburn.Micro;
+
+ using HandBrakeWPF.Model;
+ using HandBrakeWPF.ViewModels.Interfaces;
+
+ /// <summary>
+ /// A Command to display the options window.
+ /// </summary>
+ public class OpenOptionsScreenCommand : ICommand
+ {
+ /// <summary>
+ /// The can execute changed.
+ /// </summary>
+ public event EventHandler CanExecuteChanged;
+
+ /// <summary>
+ /// The can execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ /// <returns>
+ /// The <see cref="bool"/>.
+ /// </returns>
+ public bool CanExecute(object parameter)
+ {
+ return true;
+ }
+
+ /// <summary>
+ /// The execute.
+ /// </summary>
+ /// <param name="parameter">
+ /// The parameter.
+ /// </param>
+ public void Execute(object parameter)
+ {
+ var shellViewModel = IoC.Get<IShellViewModel>();
+ shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
+
+ if (parameter != null && parameter.GetType() == typeof(OptionsTab))
+ {
+ var optionsViewModel = IoC.Get<IOptionsViewModel>();
+ optionsViewModel.GotoTab((OptionsTab)parameter);
+ }
+ }
+ }
+}
\ No newline at end of file |