An asynchronous implementation of ICommand that uses delegates for the execute and can-execute logic,
accepting a command parameter of type T. This class is typically generated by the CommandAttribute aspect
for methods returning Task or when Background is true.
Namespace: Metalama.Patterns.Wpf
Assembly: Metalama.Patterns.Wpf.dll
Syntax
public sealed class AsyncDelegateCommand<T> : BaseAsyncDelegateCommand, IAsyncCommand, ICommand, INotifyPropertyChangedType Parameters
| Name | Description |
|---|---|
| T | The type of the command parameter. |
Remarks
This class implements IAsyncCommand and INotifyPropertyChanged, exposing properties like IsRunning, CanCancel, and ExecutionTask to monitor command execution state.
By default, the command cannot be executed concurrently. This can be changed via SupportsConcurrentExecution.
Methods
| Name | Description |
|---|---|
| CanExecute(T) | Determines whether the command can be executed with the specified parameter.
Returns |
| Execute(T) | Executes the command asynchronously with the specified parameter and returns a DelegateCommandExecution that can be used to track and cancel the execution. |