C# Класс Microsoft.Practices.Prism.Commands.DelegateCommandBase

An ICommand whose delegates can be attached for Execute and CanExecute. It also implements the IActiveAware interface, which is useful when registering this command in a CompositeCommand that monitors command's activity.
Наследование: ICommand, IActiveAware
Показать файл Открыть проект

Защищенные методы

Метод Описание
CanExecute ( object parameter ) : bool

Determines if the command can execute with the provided parameter by invoing the Func{Object,Bool} supplied during construction.

DelegateCommandBase ( Action executeMethod, bool>.Func canExecuteMethod ) : System

Createse a new instance of a DelegateCommandBase, specifying both the execute action and the can execute function.

Execute ( object parameter ) : void

Executes the command with the provided parameter by invoking the Action{Object} supplied during construction.

OnCanExecuteChanged ( ) : void

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute to check if the CompositeCommand can execute.

OnIsActiveChanged ( ) : void

This raises the DelegateCommandBase.IsActiveChanged event.

Приватные методы

Метод Описание
ICommand ( object parameter ) : bool
ICommand ( object parameter ) : void
RaiseCanExecuteChanged ( ) : void

Описание методов

CanExecute() защищенный Метод

Determines if the command can execute with the provided parameter by invoing the Func{Object,Bool} supplied during construction.
protected CanExecute ( object parameter ) : bool
parameter object The parameter to use when determining if this command can execute.
Результат bool

DelegateCommandBase() защищенный Метод

Createse a new instance of a DelegateCommandBase, specifying both the execute action and the can execute function.
protected DelegateCommandBase ( Action executeMethod, bool>.Func canExecuteMethod ) : System
executeMethod Action The to execute when is invoked.
canExecuteMethod bool>.Func The to invoked when is invoked.
Результат System

Execute() защищенный Метод

Executes the command with the provided parameter by invoking the Action{Object} supplied during construction.
protected Execute ( object parameter ) : void
parameter object
Результат void

OnCanExecuteChanged() защищенный Метод

Raises ICommand.CanExecuteChanged on the UI thread so every command invoker can requery ICommand.CanExecute to check if the CompositeCommand can execute.
protected OnCanExecuteChanged ( ) : void
Результат void

OnIsActiveChanged() защищенный Метод

This raises the DelegateCommandBase.IsActiveChanged event.
protected OnIsActiveChanged ( ) : void
Результат void