C# Class Pebble.WP.Common.RelayCommand

A command whose sole purpose is to relay its functionality to other objects by invoking delegates. The default return value for the CanExecute method is 'true'. RaiseCanExecuteChanged needs to be called whenever CanExecute is expected to return a different value.
Inheritance: ICommand
显示文件 Open project: barometz/flint Class Usage Examples

Public Methods

Method Description
CanExecute ( object parameter ) : bool

Determines whether this RelayCommand can execute in its current state.

Execute ( object parameter ) : void

Executes the RelayCommand on the current command target.

RaiseCanExecuteChanged ( ) : void

Method used to raise the CanExecuteChanged event to indicate that the return value of the CanExecute method has changed.

RelayCommand ( System.Action execute ) : System

Creates a new command that can always execute.

RelayCommand ( System.Action execute, Func canExecute ) : System

Creates a new command.

Method Details

CanExecute() public method

Determines whether this RelayCommand 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

Executes the RelayCommand on the current command target.
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

RaiseCanExecuteChanged() public method

Method used to raise the CanExecuteChanged event to indicate that the return value of the CanExecute method has changed.
public RaiseCanExecuteChanged ( ) : void
return void

RelayCommand() public method

Creates a new command that can always execute.
public RelayCommand ( System.Action execute ) : System
execute System.Action The execution logic.
return System

RelayCommand() public method

Creates a new command.
public RelayCommand ( System.Action execute, Func canExecute ) : System
execute System.Action The execution logic.
canExecute Func The execution status logic.
return System