C# Class Catel.MVVM.CompositeCommand

Composite command which allows several commands inside a single command being exposed to a view.
Inheritance: Command, ICompositeCommand
Show file Open project: Catel/Catel Class Usage Examples

Public Methods

Method Description
CompositeCommand ( ) : System

Initializes a new instance of the Command{TCanExecuteParameter,TExecuteParameter} class.

GetActions ( ) : IEnumerable

Gets the actions currently registered to this composite command.

GetActionsWithParameter ( ) : IEnumerable>

Gets the actions with parameters currently registered to this composite command.

GetCommands ( ) : IEnumerable

Gets the commands currently registered to this composite command.

RegisterAction ( System.Action action ) : void

Registers the specified action.

RegisterAction ( Action action ) : void

Registers the specified action.

RegisterCommand ( ICommand command, IViewModel viewModel = null ) : void

Registers the specified command.

Note that if the view model is not specified, the command must be unregistered manually in order to prevent memory leaks.

UnregisterAction ( System.Action action ) : void

Unregisters the specified action.

UnregisterAction ( Action action ) : void

Unregisters the specified action.

UnregisterCommand ( ICommand command ) : void

Unregisters the specified command.

Private Methods

Method Description
CanExecuteCompositeCommand ( object parameter ) : bool
ExecuteCompositeCommand ( object parameter ) : void
OnCommandCanExecuteChanged ( object sender, EventArgs e ) : void

Method Details

CompositeCommand() public method

Initializes a new instance of the Command{TCanExecuteParameter,TExecuteParameter} class.
public CompositeCommand ( ) : System
return System

GetActions() public method

Gets the actions currently registered to this composite command.
public GetActions ( ) : IEnumerable
return IEnumerable

GetActionsWithParameter() public method

Gets the actions with parameters currently registered to this composite command.
public GetActionsWithParameter ( ) : IEnumerable>
return IEnumerable>

GetCommands() public method

Gets the commands currently registered to this composite command.
public GetCommands ( ) : IEnumerable
return IEnumerable

RegisterAction() public method

Registers the specified action.
The is null.
public RegisterAction ( System.Action action ) : void
action System.Action The action.
return void

RegisterAction() public method

Registers the specified action.
The is null.
public RegisterAction ( Action action ) : void
action Action The action.
return void

RegisterCommand() public method

Registers the specified command.
Note that if the view model is not specified, the command must be unregistered manually in order to prevent memory leaks.
The is null.
public RegisterCommand ( ICommand command, IViewModel viewModel = null ) : void
command ICommand The command.
viewModel IViewModel The view model. If specified, the command will automatically be unregistered when the view model is closed.
return void

UnregisterAction() public method

Unregisters the specified action.
The is null.
public UnregisterAction ( System.Action action ) : void
action System.Action The action.
return void

UnregisterAction() public method

Unregisters the specified action.
The is null.
public UnregisterAction ( Action action ) : void
action Action The action.
return void

UnregisterCommand() public method

Unregisters the specified command.
The is null.
public UnregisterCommand ( ICommand command ) : void
command ICommand The command.
return void