Class ActionCommand
A basic implementation of ICommand that wraps a method that takes no parameters or a method that takes one parameter.
public sealed class ActionCommand : ICommand
- Inheritance
-
ActionCommand
- Implements
- Inherited Members
- Extension Methods
Constructors
ActionCommand(Action)
Initializes a new instance of the ActionCommand class.
public ActionCommand(Action action)
Parameters
action
ActionThe action.
Remarks
Use this constructor to provide an action that ignores the ICommand parameter.
ActionCommand(Action<object>)
Initializes a new instance of the ActionCommand class.
public ActionCommand(Action<object> objectAction)
Parameters
Remarks
Use this constructor to provide an action that uses the object parameter passed by the Execute method.
Methods
Execute(object)
Defines the method to be called when the command is invoked.
public void Execute(object parameter)
Parameters
parameter
objectData used by the command. If the command does not require data to be passed, then this object can be set to null.