Share via


AsyncValueCommand Constructors

Definition

Overloads

AsyncValueCommand(Func<ValueTask>, Func<Boolean>, Action<Exception>, Boolean, Boolean)

Initializes a new instance of AsyncValueCommand

public AsyncValueCommand(Func<System.Threading.Tasks.ValueTask> execute, Func<bool> canExecute, Action<Exception>? onException = default, bool continueOnCapturedContext = false, bool allowsMultipleExecutions = true);

Parameters

execute
System.Func<System.Threading.Tasks.ValueTask>

The Function executed when Execute or ExecuteAsync is called. This does not check canExecute before executing and will execute even if canExecute is false

canExecute
System.Func<System.Boolean>

The Function that verifies whether or not AsyncCommand should execute.

onException
System.Action<System.Exception>

If an exception is thrown in the Task, onException will execute. If onException is null, the exception will be re-thrown

continueOnCapturedContext
System.Boolean

If set to true continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to false continue on a different context; this will allow the Synchronization Context to continue on a different thread

allowsMultipleExecutions
System.Boolean

Applies to

AsyncValueCommand(Func<ValueTask>, Func<Object,Boolean>, Action<Exception>, Boolean, Boolean)

Initializes a new instance of AsyncValueCommand

public AsyncValueCommand(Func<System.Threading.Tasks.ValueTask> execute, Func<object,bool>? canExecute = default, Action<Exception>? onException = default, bool continueOnCapturedContext = false, bool allowsMultipleExecutions = true);

Parameters

execute
System.Func<System.Threading.Tasks.ValueTask>

The Function executed when Execute or ExecuteAsync is called. This does not check canExecute before executing and will execute even if canExecute is false

canExecute
System.Func<System.Object,System.Boolean>

The Function that verifies whether or not AsyncCommand should execute.

onException
System.Action<System.Exception>

If an exception is thrown in the Task, onException will execute. If onException is null, the exception will be re-thrown

continueOnCapturedContext
System.Boolean

If set to true continue on captured context; this will ensure that the Synchronization Context returns to the calling thread. If set to false continue on a different context; this will allow the Synchronization Context to continue on a different thread

allowsMultipleExecutions
System.Boolean

Applies to