示例#1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="StopCommandBinding&lt;TController, TModel&gt;"/> class.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        public StopCommandBinding(ShellViewModel viewModel)
        {
            this.Command = MediaCommands.Stop;

            StopCommand command = new StopCommand(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);
            };
        }
示例#2
0
 internal static void Execute(ShellViewModel viewModel)
 {
     StopCommand.Stop(viewModel);
 }
示例#3
0
 internal static bool CanExecute(ShellViewModel viewModel)
 {
     return(StopCommand.CanStop(viewModel));
 }