Table of Contents

Class ActionCommand

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll

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 Action

The 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

objectAction Action<object>

An action that takes an object parameter.

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 object

Data used by the command. If the command does not require data to be passed, then this object can be set to null.