AsyncRelayCommand<T> Constructors
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AsyncRelayCommand<T>(Func<T,CancellationToken,Task>)
- Source:
- AsyncRelayCommand%7BT%7D.cs
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (cancelableExecute As Func(Of T, CancellationToken, Task))
Parameters
- cancelableExecute
- Func<T,CancellationToken,Task>
The cancelable execution logic.
Exceptions
Thrown if cancelableExecute
is null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,Task>)
- Source:
- AsyncRelayCommand%7BT%7D.cs
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.Tasks.Task> execute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task))
Parameters
Exceptions
Thrown if execute
is null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,CancellationToken,Task>, AsyncRelayCommandOptions)
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (cancelableExecute As Func(Of T, CancellationToken, Task), options As AsyncRelayCommandOptions)
Parameters
- cancelableExecute
- Func<T,CancellationToken,Task>
The cancelable execution logic.
- options
- AsyncRelayCommandOptions
The options to use to configure the async command.
Exceptions
Thrown if cancelableExecute
is null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,CancellationToken,Task>, Predicate<T>)
- Source:
- AsyncRelayCommand%7BT%7D.cs
- Source:
- AsyncRelayCommand%7BT%7D.cs
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 CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Predicate<'T> -> CommunityToolkit.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.
Exceptions
Thrown if cancelableExecute
or canExecute
are null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,Task>, AsyncRelayCommandOptions)
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.Tasks.Task> execute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task), options As AsyncRelayCommandOptions)
Parameters
- options
- AsyncRelayCommandOptions
The options to use to configure the async command.
Exceptions
Thrown if execute
is null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,Task>, Predicate<T>)
- Source:
- AsyncRelayCommand%7BT%7D.cs
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.Tasks.Task> execute, Predicate<T?> canExecute);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> * Predicate<'T> -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task), canExecute As Predicate(Of T))
Parameters
- canExecute
- Predicate<T>
The execution status logic.
Exceptions
Thrown if execute
or canExecute
are null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,CancellationToken,Task>, Predicate<T>, AsyncRelayCommandOptions)
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.CancellationToken,System.Threading.Tasks.Task> cancelableExecute, Predicate<T?> canExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.CancellationToken, System.Threading.Tasks.Task> * Predicate<'T> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (cancelableExecute As Func(Of T, CancellationToken, Task), canExecute As Predicate(Of T), options As AsyncRelayCommandOptions)
Parameters
- cancelableExecute
- Func<T,CancellationToken,Task>
The cancelable execution logic.
- canExecute
- Predicate<T>
The execution status logic.
- options
- AsyncRelayCommandOptions
The options to use to configure the async command.
Exceptions
Thrown if cancelableExecute
or canExecute
are null
.
Remarks
See notes in RelayCommand<T>(Action<T>).
Applies to
AsyncRelayCommand<T>(Func<T,Task>, Predicate<T>, AsyncRelayCommandOptions)
- Source:
- AsyncRelayCommand%7BT%7D.cs
Initializes a new instance of the AsyncRelayCommand<T> class.
public AsyncRelayCommand(Func<T?,System.Threading.Tasks.Task> execute, Predicate<T?> canExecute, CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions options);
new CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T> : Func<'T, System.Threading.Tasks.Task> * Predicate<'T> * CommunityToolkit.Mvvm.Input.AsyncRelayCommandOptions -> CommunityToolkit.Mvvm.Input.AsyncRelayCommand<'T>
Public Sub New (execute As Func(Of T, Task), canExecute As Predicate(Of T), options As AsyncRelayCommandOptions)
Parameters
- canExecute
- Predicate<T>
The execution status logic.
- options
- AsyncRelayCommandOptions
The options to use to configure the async command.
Exceptions
Thrown if execute
or canExecute
are null
.
Remarks
See notes in RelayCommand<T>(Action<T>).