C# Class System.Waf.Applications.DelegateCommand

An ICommand whose delegates can be attached for Execute and CanExecute.
Inheritance: ICommand
Mostra file Open project: jbe2277/waf Class Usage Examples

Public Methods

Method Description
CanExecute ( object parameter ) : bool

Defines the method that determines whether the command can execute in its current state.

DelegateCommand ( Action execute ) : System.Windows.Input

Initializes a new instance of the DelegateCommand class.

DelegateCommand ( Action execute, Func canExecute ) : System.Windows.Input

Initializes a new instance of the DelegateCommand class.

DelegateCommand ( Action execute ) : System.Windows.Input

Initializes a new instance of the DelegateCommand class.

DelegateCommand ( Action execute, bool>.Func canExecute ) : System.Windows.Input

Initializes a new instance of the DelegateCommand class.

Execute ( object parameter ) : void

Defines the method to be called when the command is invoked.

RaiseCanExecuteChanged ( ) : void

Raises the CanExecuteChanged event.

Protected Methods

Method Description
OnCanExecuteChanged ( EventArgs e ) : void

Raises the CanExecuteChanged event.

Method Details

CanExecute() public method

Defines the method that determines whether the command can execute in its current state.
public CanExecute ( object parameter ) : bool
parameter object Data used by the command. If the command does not require data to be passed, this object can be set to null.
return bool

DelegateCommand() public method

Initializes a new instance of the DelegateCommand class.
The execute argument must not be null.
public DelegateCommand ( Action execute ) : System.Windows.Input
execute Action Delegate to execute when Execute is called on the command.
return System.Windows.Input

DelegateCommand() public method

Initializes a new instance of the DelegateCommand class.
The execute argument must not be null.
public DelegateCommand ( Action execute, Func canExecute ) : System.Windows.Input
execute Action Delegate to execute when Execute is called on the command.
canExecute Func Delegate to execute when CanExecute is called on the command.
return System.Windows.Input

DelegateCommand() public method

Initializes a new instance of the DelegateCommand class.
The execute argument must not be null.
public DelegateCommand ( Action execute ) : System.Windows.Input
execute Action Delegate to execute when Execute is called on the command.
return System.Windows.Input

DelegateCommand() public method

Initializes a new instance of the DelegateCommand class.
The execute argument must not be null.
public DelegateCommand ( Action execute, bool>.Func canExecute ) : System.Windows.Input
execute Action Delegate to execute when Execute is called on the command.
canExecute bool>.Func Delegate to execute when CanExecute is called on the command.
return System.Windows.Input

Execute() public method

Defines the method to be called when the command is invoked.
public Execute ( object parameter ) : void
parameter object Data used by the command. If the command does not require data to be passed, this object can be set to null.
return void

OnCanExecuteChanged() protected method

Raises the CanExecuteChanged event.
protected OnCanExecuteChanged ( EventArgs e ) : void
e EventArgs The instance containing the event data.
return void

RaiseCanExecuteChanged() public method

Raises the CanExecuteChanged event.
public RaiseCanExecuteChanged ( ) : void
return void