/// <summary> /// Initializes a new instance of the <see cref="PauseCommandBinding<TController, TModel>"/> class. /// </summary> /// <param name="viewModel">The view model.</param> public PauseCommandBinding(ShellViewModel viewModel) { this.Command = MediaCommands.Pause; PauseCommand command = new PauseCommand(viewModel); this.CanExecute += delegate(object sender, CanExecuteRoutedEventArgs e) { e.CanExecute = command.CanExecute(e.Parameter); }; this.Executed += delegate(object sender, ExecutedRoutedEventArgs e) { command.Execute(e.Parameter); }; }
internal static void Execute(ShellViewModel viewModel) { PauseCommand.Pause(viewModel); }
internal static bool CanExecute(ShellViewModel viewModel) { return(PauseCommand.CanPause(viewModel)); }