Edit

Share via


AsyncRelayCommand<T> Constructors

Definition

Overloads

AsyncRelayCommand<T>(Func<T,CancellationToken,Task>)

Initializes a new instance of the AsyncRelayCommand<T> class that can always execute.

AsyncRelayCommand<T>(Func<T,Task>)

Initializes a new instance of the AsyncRelayCommand<T> class that can always execute.

AsyncRelayCommand<T>(Func<T,CancellationToken,Task>, Predicate<T>)

Initializes a new instance of the AsyncRelayCommand<T> class.

AsyncRelayCommand<T>(Func<T,Task>, Predicate<T>)

Initializes a new instance of the AsyncRelayCommand<T> class.

AsyncRelayCommand<T>(Func<T,CancellationToken,Task>)

Initializes a new instance of the AsyncRelayCommand<T> class that can always execute.

public AsyncRelayCommand (Func<T?,System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute);
new Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> -> Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (cancelableExecute As Func(Of T, CancellationToken, Task))

Parameters

cancelableExecute
Func<T,CancellationToken,Task>

The cancelable execution logic.

Remarks

See notes in RelayCommand<T>(Action<T>).

Applies to

AsyncRelayCommand<T>(Func<T,Task>)

Initializes a new instance of the AsyncRelayCommand<T> class that can always execute.

public AsyncRelayCommand (Func<T?,System.Threading.Tasks.Task> execute);
new Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> -> Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task))

Parameters

execute
Func<T,Task>

The execution logic.

Remarks

See notes in RelayCommand<T>(Action<T>).

Applies to

AsyncRelayCommand<T>(Func<T,CancellationToken,Task>, Predicate<T>)

Initializes a new instance of the AsyncRelayCommand<T> class.

public AsyncRelayCommand (Func<T?,System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, Predicate<T?> canExecute);
new Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Predicate<'T> -> Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (cancelableExecute As Func(Of T, CancellationToken, Task), canExecute As Predicate(Of T))

Parameters

cancelableExecute
Func<T,CancellationToken,Task>

The cancelable execution logic.

canExecute
Predicate<T>

The execution status logic.

Remarks

See notes in RelayCommand<T>(Action<T>).

Applies to

AsyncRelayCommand<T>(Func<T,Task>, Predicate<T>)

Initializes a new instance of the AsyncRelayCommand<T> class.

public AsyncRelayCommand (Func<T?,System.Threading.Tasks.Task> execute, Predicate<T?> canExecute);
new Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> * Predicate<'T> -> Microsoft.Toolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task), canExecute As Predicate(Of T))

Parameters

execute
Func<T,Task>

The execution logic.

canExecute
Predicate<T>

The execution status logic.

Remarks

See notes in RelayCommand<T>(Action<T>).

Applies to