// --------------------------------------------------------------------------------------------------------------------
//
// 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;
///
/// 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();
shellViewModel.DisplayWindow(ShellWindow.OptionsWindow);
if (parameter != null && parameter.GetType() == typeof(OptionsTab))
{
var optionsViewModel = IoC.Get();
optionsViewModel.GotoTab((OptionsTab)parameter);
}
}
}
}