Skip to main content

AsyncCommand(Func<T, CancellationToken, Task>, Func<T, Boolean>, Boolean) Constructor

Initializes a new instance of the AsyncCommand<T> class with specified settings.

Namespace: DevExpress.Mvvm

Assembly: DevExpress.WinUI.Mvvm.v23.2.dll

NuGet Package: DevExpress.WinUI

Declaration

public AsyncCommand(
    Func<T, CancellationToken, Task> execute,
    Func<T, bool> canExecute = null,
    bool allowMultipleExecution = false
)

Parameters

Name Type Description
execute Func<T, CancellationToken, Task>

The execute delegate. The delegate parameter allows you to implement cancellation logic.

Optional Parameters

Name Type Default Description
canExecute Func<T, Boolean> null

A delegate that determines whether a command can be executed.

allowMultipleExecution Boolean False

true if the AsyncCommand allows you to invoke the execute delegate while its execution is in progress; otherwise false.

See Also