C# Class 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.
Inheritance: ICommand, IActiveAware
Afficher le fichier Open project: xperiandri/PortablePrism

Méthodes protégées

Méthode Description
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.

Private Methods

Méthode Description
ICommand ( object parameter ) : bool
ICommand ( object parameter ) : void
RaiseCanExecuteChanged ( ) : void

Method Details

CanExecute() protected méthode

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.
Résultat bool

DelegateCommandBase() protected méthode

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.
Résultat System

Execute() protected méthode

Executes the command with the provided parameter by invoking the Action{Object} supplied during construction.
protected Execute ( object parameter ) : void
parameter object
Résultat void

OnCanExecuteChanged() protected méthode

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
Résultat void

OnIsActiveChanged() protected méthode

This raises the DelegateCommandBase.IsActiveChanged event.
protected OnIsActiveChanged ( ) : void
Résultat void