// -------------------------------------------------------------------------------------------------------------------- // // This file is part of the HandBrake source code - It may be used under the terms of the GNU General Public License. // // // A Command to display the options window. // // -------------------------------------------------------------------------------------------------------------------- namespace HandBrakeWPF.Commands { using System; using System.Windows.Input; using Caliburn.Micro; using HandBrakeWPF.Model; using HandBrakeWPF.ViewModels.Interfaces; /// /// A Command to display the options window. /// public class OpenOptionsScreenCommand : ICommand { /// /// The can execute changed. /// public event EventHandler CanExecuteChanged { add { } remove { } } /// /// The can execute. /// /// /// The parameter. /// /// /// The . /// public bool CanExecute(object parameter) { return true; } /// /// The execute. /// /// /// The parameter. /// public void Execute(object parameter) { var shellViewModel = IoC.Get(); var optionsViewModel = IoC.Get(); shellViewModel.DisplayWindow(ShellWindow.OptionsWindow); if (parameter == null && optionsViewModel.SelectedTab == OptionsTab.About) { optionsViewModel.GotoTab(OptionsTab.General); } if (parameter != null && parameter.GetType() == typeof(OptionsTab)) { optionsViewModel.GotoTab((OptionsTab)parameter); if (((OptionsTab)parameter).Equals(OptionsTab.Updates)) { optionsViewModel.PerformUpdateCheck(); } } } } }