Show / Hide Table of Contents

Class DelegateCommand

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

Inheritance
System.Object
DelegateCommandBase
DelegateCommand
Implements
System.Windows.Input.ICommand
IActiveAware
DelegateCommandBase.CanExecuteChanged
DelegateCommandBase.IsActiveChanged
DelegateCommandBase.IsActive
DelegateCommandBase.RaiseCanExecuteChanged()
DelegateCommandBase.CanExecute(Object)
DelegateCommandBase.Execute(Object)
DelegateCommandBase.OnCanExecuteChanged()
DelegateCommandBase.OnIsActiveChanged()
DelegateCommandBase.ICommand.CanExecute(Object)
DelegateCommandBase.ICommand.Execute(Object)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.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 System.Action to invoke on execution.

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

The System.Action to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called.

View Source

DelegateCommand(Action, Func<Boolean>)

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

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

The System.Action to invoke when System.Windows.Input.ICommand.Execute(System.Object) is called.

System.Func<System.Boolean> canExecuteMethod

The System.Func<TResult> to invoke when System.Windows.Input.ICommand.CanExecute(System.Object) is called

Methods

View Source

CanExecute()

Determines if the command can be executed.

Declaration
public bool CanExecute()
Returns
Type Description
System.Boolean

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

View Source

Execute()

Executes the command.

Declaration
public void Execute()

Implements

System.Windows.Input.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