C# Class System.Waf.Applications.AsyncDelegateCommand

Provides an ICommand implementation which relays the Execute and CanExecute method to the specified delegates. This implementation disables the command during the async command execution.
Inheritance: ICommand
Exibir arquivo Open project: jbe2277/waf Class Usage Examples

Private Properties

Property Type Description

Public Methods

Method Description
AsyncDelegateCommand ( Func execute ) : System.Threading.Tasks

Initializes a new instance of the AsyncDelegateCommand class.

AsyncDelegateCommand ( Func execute, Func canExecute ) : System.Threading.Tasks

Initializes a new instance of the AsyncDelegateCommand class.

AsyncDelegateCommand ( Task>.Func execute ) : System.Threading.Tasks

Initializes a new instance of the AsyncDelegateCommand class.

AsyncDelegateCommand ( Task>.Func execute, bool>.Func canExecute ) : System.Threading.Tasks

Initializes a new instance of the AsyncDelegateCommand class.

CanExecute ( object parameter ) : bool

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

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

AsyncDelegateCommand() public method

Initializes a new instance of the AsyncDelegateCommand class.
The execute argument must not be null.
public AsyncDelegateCommand ( Func execute ) : System.Threading.Tasks
execute Func Async Delegate to execute when Execute is called on the command.
return System.Threading.Tasks

AsyncDelegateCommand() public method

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

AsyncDelegateCommand() public method

Initializes a new instance of the AsyncDelegateCommand class.
The execute argument must not be null.
public AsyncDelegateCommand ( Task>.Func execute ) : System.Threading.Tasks
execute Task>.Func Async Delegate to execute when Execute is called on the command.
return System.Threading.Tasks

AsyncDelegateCommand() public method

Initializes a new instance of the AsyncDelegateCommand class.
The execute argument must not be null.
public AsyncDelegateCommand ( Task>.Func execute, bool>.Func canExecute ) : System.Threading.Tasks
execute Task>.Func Async 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.Threading.Tasks

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

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