public AsyncCommand ( Func execute, Func canExecute = null, Action onException = null, bool continueOnCapturedContext = true ) : System | ||
execute | Func | The Function executed when Execute or ExecuteAysnc is called. This does not check canExecute before executing and will execute even if canExecute is false |
canExecute | Func | The Function that verifies whether or not AsyncCommand should execute. |
onException | Action | If an exception is thrown in the Task, |
continueOnCapturedContext | bool | If set to |
return | System |
public AsyncCommand(Func<T, Task> execute,
Func<object, bool> canExecute = null,
Action<Exception> onException = null,
bool continueOnCapturedContext = true)
{
_execute = execute ?? throw new ArgumentNullException(nameof(execute), $"{nameof(execute)} cannot be null");
_canExecute = canExecute ?? (_ => true);
_onException = onException;
_continueOnCapturedContext = continueOnCapturedContext;
}
#endregion