Class AsyncRelayCommand<TParam>
A reusable command that encapsulates the implementation of ICommand with support for async/await command delegates.
Enables instant creation of an ICommand without implementing the ICommand interface for each command.
The AsyncRelayCommand<TParam> accepts asynchronous command handlers and supports data bindng to properties like IsExecuting by implementing INotifyPropertyChanged.
Call and await the ExecuteAsync() method or one of its overloads to execute the command explicitly asynchronously.
ICommand
Inheritance
AsyncRelayCommand<TParam>
Assembly: BionicCode.Utilities.Net.Wpf.dll
Syntax
public class AsyncRelayCommand<TParam> : AsyncRelayCommandCommon<TParam>, IAsyncRelayCommand<TParam>, IAsyncRelayCommandCommon<TParam>, IAsyncRelayCommand, IAsyncRelayCommandCommon, ICommand, INotifyPropertyChanged
Type Parameters
Remarks
Constructors
|
Improve this Doc
View Source
AsyncRelayCommand()
Declaration
protected AsyncRelayCommand()
|
Improve this Doc
View Source
AsyncRelayCommand(Action)
Declaration
public AsyncRelayCommand(Action executeNoParam)
Parameters
| Type |
Name |
Description |
| Action |
executeNoParam |
|
|
Improve this Doc
View Source
AsyncRelayCommand(Action, Func<Boolean>)
Declaration
public AsyncRelayCommand(Action executeNoParam, Func<bool> canExecuteNoParam)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Action<TParam, CancellationToken>)
Declaration
public AsyncRelayCommand(Action<TParam, CancellationToken> execute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Action<TParam, CancellationToken>, Predicate<TParam>)
Declaration
public AsyncRelayCommand(Action<TParam, CancellationToken> executeAsync, Predicate<TParam> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Action<TParam>)
Declaration
public AsyncRelayCommand(Action<TParam> execute)
Parameters
| Type |
Name |
Description |
| Action<TParam> |
execute |
|
|
Improve this Doc
View Source
AsyncRelayCommand(Action<TParam>, Predicate<TParam>)
Declaration
public AsyncRelayCommand(Action<TParam> execute, Predicate<TParam> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Action<CancellationToken>)
Declaration
public AsyncRelayCommand(Action<CancellationToken> executeNoParam)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Action<CancellationToken>, Func<Boolean>)
Declaration
public AsyncRelayCommand(Action<CancellationToken> executeAsync, Func<bool> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<TParam, CancellationToken, Task>)
Declaration
public AsyncRelayCommand(Func<TParam, CancellationToken, Task> executeAsync)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<TParam, CancellationToken, Task>, Predicate<TParam>)
Declaration
public AsyncRelayCommand(Func<TParam, CancellationToken, Task> executeAsync, Predicate<TParam> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<TParam, Task>)
Declaration
public AsyncRelayCommand(Func<TParam, Task> executeAsync)
Parameters
| Type |
Name |
Description |
| Func<TParam, Task> |
executeAsync |
|
|
Improve this Doc
View Source
AsyncRelayCommand(Func<TParam, Task>, Predicate<TParam>)
Declaration
public AsyncRelayCommand(Func<TParam, Task> executeAsync, Predicate<TParam> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<CancellationToken, Task>)
Declaration
public AsyncRelayCommand(Func<CancellationToken, Task> executeAsyncNoParam)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<CancellationToken, Task>, Func<Boolean>)
Declaration
public AsyncRelayCommand(Func<CancellationToken, Task> executeAsync, Func<bool> canExecute)
Parameters
|
Improve this Doc
View Source
AsyncRelayCommand(Func<Task>)
Declaration
public AsyncRelayCommand(Func<Task> executeAsyncNoParam)
Parameters
| Type |
Name |
Description |
| Func<Task> |
executeAsyncNoParam |
|
|
Improve this Doc
View Source
AsyncRelayCommand(Func<Task>, Func<Boolean>)
Declaration
public AsyncRelayCommand(Func<Task> executeAsyncNoParam, Func<bool> canExecuteNoParam)
Parameters
Properties
|
Improve this Doc
View Source
IsCommandManagerRequerySuggestedEnabled
Declaration
public bool IsCommandManagerRequerySuggestedEnabled { get; set; }
Property Value
Remarks
Events
|
Improve this Doc
View Source
CanExecuteChanged
Declaration
public event EventHandler CanExecuteChanged
Event Type
Implements
Extension Methods