CreateParametricAsyncDelegateCommand<T>(Func<T, CancellationToken, Task>, Func<T, bool>?, bool, bool, bool)
Creates an asynchronous command that accepts a parameter, with configurable cancellation support.
Declaration
public static AsyncDelegateCommand<T> CreateParametricAsyncDelegateCommand<T>(Func<T, CancellationToken, Task> execute, Func<T, bool>? canExecute, bool supportsCancellation, bool supportsConcurrentExecution, bool runsInBackground)Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, CancellationToken, Task> | execute | The async delegate to invoke when the command is executed. Receives the parameter and a CancellationToken. |
| Func<T, bool> | canExecute | An optional delegate that determines whether the command can execute for a given parameter. If |
| bool | supportsCancellation | If |
| bool | supportsConcurrentExecution | If |
| bool | runsInBackground | If |
Returns
| Type | Description |
|---|---|
| AsyncDelegateCommand<T> | A new AsyncDelegateCommand<T> instance. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the command parameter. |
CreateParametricAsyncDelegateCommand<T>(Func<T, Task>, Func<T, bool>?, bool, bool, bool)
Creates an asynchronous command that accepts a parameter, without cancellation token in the delegate, with configurable cancellation support.
Declaration
public static AsyncDelegateCommand<T> CreateParametricAsyncDelegateCommand<T>(Func<T, Task> execute, Func<T, bool>? canExecute, bool supportsCancellation, bool supportsConcurrentExecution, bool runsInBackground)Parameters
| Type | Name | Description |
|---|---|---|
| Func<T, Task> | execute | The async delegate to invoke when the command is executed. |
| Func<T, bool> | canExecute | An optional delegate that determines whether the command can execute for a given parameter. If |
| bool | supportsCancellation | If |
| bool | supportsConcurrentExecution | If |
| bool | runsInBackground | If |
Returns
| Type | Description |
|---|---|
| AsyncDelegateCommand<T> | A new AsyncDelegateCommand<T> instance. |
Type Parameters
| Name | Description |
|---|---|
| T | The type of the command parameter. |