C# Class GeekyTool.Core.Commands.DelegateCommand

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'. This class does not allow you to accept command parameters in the Execute and CanExecute callback methods.
Inheritance: ICommand
ファイルを表示 Open project: GeekyTheory/GeekyTool

Public Methods

Method Description
CanExecute ( object parameter ) : bool

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

DelegateCommand ( System.Action exec ) : System

Initializes a new instance of the DelegateCommand class.

DelegateCommand ( System.Action exec, Func canExec ) : System

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

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.
public DelegateCommand ( System.Action exec ) : System
exec System.Action The execute.
return System

DelegateCommand() public method

Initializes a new instance of the DelegateCommand class.
public DelegateCommand ( System.Action exec, Func canExec ) : System
exec System.Action The execute.
canExec Func The can execute.
return System

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

RaiseCanExecuteChanged() public method

public RaiseCanExecuteChanged ( ) : void
return void