Example #1
0
 public AsyncCommand(Func <Task> execute, TaskWatcher watcher = null, Func <bool> canExecute = null)
 {
     _execute = x => execute();
     _watcher = watcher ?? new TaskWatcher();
     if (canExecute != null)
     {
         _canExecute = x => canExecute();
     }
 }
Example #2
0
 public AsyncCommand(
     Func <object, Task> execute,
     TaskWatcher watcher            = null,
     Func <object, bool> canExecute = null)
 {
     _execute    = execute;
     _canExecute = canExecute;
     _watcher    = watcher ?? new TaskWatcher();
 }