Show / Hide Table of Contents

Class DelegateCommand

An ICommand whose delegates do not take any parameters for Execute() and CanExecute().

Inheritance
object
DelegateCommandBase
DelegateCommand
Implements
ICommand
IActiveAware
DelegateCommandBase.CanExecuteChanged
DelegateCommandBase.IsActiveChanged
DelegateCommandBase.IsActive
DelegateCommandBase.RaiseCanExecuteChanged()
DelegateCommandBase.CanExecute(object)
DelegateCommandBase.Execute(object)
DelegateCommandBase.OnCanExecuteChanged()
DelegateCommandBase.OnIsActiveChanged()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Sartorius.SAF.Presentation.Commands
Assembly: Sartorius.SAF.Presentation.dll
Syntax
public class DelegateCommand : DelegateCommandBase, ICommand, IActiveAware

Constructors

View Source

DelegateCommand(Action)

Creates a new instance of DelegateCommand with the Action to invoke on execution.

Declaration
public DelegateCommand(Action executeMethod)
Parameters
Type Name Description
Action executeMethod

The Action to invoke when Execute(object) is called.

View Source

DelegateCommand(Action, Func<bool>)

Creates a new instance of DelegateCommand with the Action to invoke on execution and a Func to query for determining if the command can execute.

Declaration
public DelegateCommand(Action executeMethod, Func<bool> canExecuteMethod)
Parameters
Type Name Description
Action executeMethod

The Action to invoke when Execute(object) is called.

Func<bool> canExecuteMethod

The Func<TResult> to invoke when CanExecute(object) is called

Methods

View Source

CanExecute()

Determines if the command can be executed.

Declaration
public bool CanExecute()
Returns
Type Description
bool

Returns true if the command can execute,otherwise returns false.

View Source

Execute()

Executes the command.

Declaration
public void Execute()

Implements

ICommand
IActiveAware

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)

See Also

DelegateCommandBase
DelegateCommand<T>
  • View Source
Back to top Generated by DocFX