+Class AsyncRelayCommand<T> +
+ +- Namespace
- BB84.Notifications
- Assembly
- BB84.Notifications.dll
The async relay command class.
+public sealed class AsyncRelayCommand<T> : IAsyncRelayCommand<T>, ICommand
+ Type Parameters
+-
+
T
+ The generic type to work with.
+
+
-
+
- Inheritance +
-
+
+ AsyncRelayCommand<T>+
+
-
+
- Implements +
- + + + +
-
+
- Inherited Members +
-
+
+
+
+ + object.GetType() ++ + +
Remarks
+For all commands that need a parameter.
+Constructors +
+ + + + ++ AsyncRelayCommand(Func<T, Task>) + +
+ +Initializes a new instance of AsyncRelayCommand<T> class that can always execute.
+public AsyncRelayCommand(Func<T, Task> execute)
+ Parameters
+ + + + + + + + + + + + + + + ++ AsyncRelayCommand(Func<T, Task>, Func<T, bool>?) + +
+ +The async relay command class.
+public AsyncRelayCommand(Func<T, Task> execute, Func<T, bool>? canExecute)
+ Parameters
+-
+
execute
Func<T, Task>
+ The task to execute.
+
+ canExecute
Func<T, bool>
+ The condition to execute.
+
+
Remarks
+For all commands that need a parameter.
+Methods +
+ + + + ++ CanExecute(object?) + +
+ + + + +public bool CanExecute(object? parameter)
+ Parameters
+-
+
parameter
object
+
+
Returns
+-
+
- bool + +
+ CanExecute(T) + +
+ +Defines the method that determines whether the command can execute in its current state.
+public bool CanExecute(T parameter)
+ Parameters
+-
+
parameter
T
+ The data used by the command.
+
+
Returns
+-
+
- bool +
True if this command can be executed, otherwise false.
+
+
+ Execute(object?) + +
+ + + + +public void Execute(object? parameter)
+ Parameters
+-
+
parameter
object
+
+
+ ExecuteAsync(T) + +
+ +Defines the method to be called when the command is invoked.
+public Task ExecuteAsync(T parameter)
+ Parameters
+-
+
parameter
T
+ The data used by the command.
+
+
Returns
+ + + + + + + + + + + + + + ++ RaiseCanExecuteChanged() + +
+ +Notifies that the CanExecuteChanged property has changed.
+public void RaiseCanExecuteChanged()
+ Events +
+ + + ++ CanExecuteChanged + +
+ + + + +public event EventHandler? CanExecuteChanged
+ Event Type
+-
+
- EventHandler + +