Class
UndoableDelegateCommand

Base class for undoable actions based on delegates.

Definition

Namespace:Telerik.Windows.Diagrams.Core

Assembly:Telerik.Windows.Diagrams.Core.dll

Syntax:

cs-api-definition
public class UndoableDelegateCommand : ICommand

Inheritance: objectUndoableDelegateCommand

Derived Classes: AsyncStateCommandCompositeCommandDrawCommand

Implements: ICommand

Constructors

UndoableDelegateCommand(string, Action<object>, Action<object>, Predicate<object>)

Initializes a new instance of the UndoableDelegateCommand class.

Declaration

cs-api-definition
public UndoableDelegateCommand(string name, Action<object> execute, Action<object> undo = null, Predicate<object> canExecute = null)

Parameters

name

string

The name or title of the command.

execute

Action<object>

The redo or execute method.

undo

Action<object>

The undo or rollback method.

canExecute

Predicate<object>

The method returning whether the command can be executed.

Properties

Name

Gets or sets the name.

Declaration

cs-api-definition
public string Name { get; set; }

Property Value

string

The name.

Implements ICommand.Name

Methods

CanExecute(object)

Gets a value indicating whether this command can be executed.

Declaration

cs-api-definition
public virtual bool CanExecute(object state = null)

Parameters

state

object

Returns

bool

Implements ICommand.CanExecute(object)

Execute(object)

Executes an undoable action.

Declaration

cs-api-definition
public virtual void Execute(object state = null)

Parameters

state

object

Implements ICommand.Execute(object)

Redo()

Executes an undoable action.

Declaration

cs-api-definition
public virtual void Redo()

Implements ICommand.Redo()

Undo(object)

Unwinds an undoable action.

Declaration

cs-api-definition
public virtual void Undo(object state = null)

Parameters

state

object

Implements ICommand.Undo(object)