Open sandboxFocus

Class DelegateCommand<T>

An implementation of ICommand that uses delegates for the Execute(T) and CanExecute(T) logic, accepting a command parameter of type T. This class is typically generated by the CommandAttribute aspect.

Inheritance
DelegateCommand<T>
Implements
Namespace: Metalama.Patterns.Wpf
Assembly: Metalama.Patterns.Wpf.dll
Syntax
public sealed class DelegateCommand<T> : BaseDelegateCommand, ICommand
Type Parameters
Name Description
T

The type of the command parameter.

Remarks

When integrated with an INotifyPropertyChanged implementation for the CanExecute property, the CanExecuteChanged event is automatically raised.

Methods

Name Description
CanExecute(T)

Determines whether the command can be executed with the specified parameter. Returns true if no CanExecute delegate was provided, or if the delegate returns true.

Execute(T)

Executes the command with the specified parameter.

Extension Methods

See Also