Show / Hide Table of Contents

Class DelegateCommand<T>

Inheritance
System.Object
DelegateCommandBase
DelegateCommand<T>
SaveFilterAsFavoriteCommand
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<T> : DelegateCommandBase, ICommand, IActiveAware
Type Parameters
Name Description
T

Constructors

View Source

DelegateCommand(Action<T>)

Initializes a new instance of DelegateCommand<T>.

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

Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.

Remarks

CanExecute(T) will always return true.

View Source

DelegateCommand(Action<T>, Func<T, Boolean>)

Initializes a new instance of DelegateCommand<T>.

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

Delegate to execute when Execute is called on the command. This can be null to just hook up a CanExecute delegate.

System.Func<T, System.Boolean> canExecuteMethod

Delegate to execute when CanExecute is called on the command. This can be null.

Exceptions
Type Condition
System.ArgumentNullException

When both executeMethod and canExecuteMethod ar null.

Methods

View Source

CanExecute(T)

Determines if the command can execute by invoked the System.Func<T, TResult> provided during construction.

Declaration
public bool CanExecute(T parameter)
Parameters
Type Name Description
T parameter

Data used by the command to determine if it can execute.

Returns
Type Description
System.Boolean

true if this command can be executed; otherwise, false.

View Source

Execute(T)

Executes the command and invokes the System.Action<T> provided during construction.

Declaration
public void Execute(T parameter)
Parameters
Type Name Description
T parameter

Data used by the command.

Implements

System.Windows.Input.ICommand
IActiveAware

Extension Methods

CollectionExtensions.AddRange<T, TCollection>(TCollection, IEnumerable<T>)
SerializableObjectCloneExtension.Clone<T>(T)
  • View Source
Back to top Generated by DocFX