AsyncValueCommand<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
| AsyncValueCommand<T>(Func<T,ValueTask>, Func<Boolean>, Action<Exception>, Boolean, Boolean) |
Initializes a new instance of AsyncValueCommand |
| AsyncValueCommand<T>(Func<T,ValueTask>, Func<Object,Boolean>, Action<Exception>, Boolean, Boolean) |
Initializes a new instance of AsyncValueCommand |
AsyncValueCommand<T>(Func<T,ValueTask>, Func<Boolean>, Action<Exception>, Boolean, Boolean)
Initializes a new instance of AsyncValueCommand
public AsyncValueCommand(Func<T,System.Threading.Tasks.ValueTask>? execute, Func<bool> canExecute, Action<Exception>? onException = default, bool continueOnCapturedContext = false, bool allowsMultipleExecutions = true);
Parameters
- execute
- System.Func<T,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<T>(Func<T,ValueTask>, Func<Object,Boolean>, Action<Exception>, Boolean, Boolean)
Initializes a new instance of AsyncValueCommand
public AsyncValueCommand(Func<T,System.Threading.Tasks.ValueTask>? execute, Func<object,bool> canExecute = default, Action<Exception>? onException = default, bool continueOnCapturedContext = false, bool allowsMultipleExecutions = true);
Parameters
- execute
- System.Func<T,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