Esempio n. 1
0
 public AsyncCommand(Func <CancellationToken, object, Task <TResult> > command, Predicate <object> canExecute)
 {
     this.command    = command;
     this.canExecute = canExecute;
     cancelCommand   = new CancelAsyncCommand();
 }
Esempio n. 2
0
 public AsyncCommand(Func <CancellationToken, Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 3
0
 public AsyncCommand(string name, Func <CancellationToken, Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
     Name           = name;
 }
 /// <summary>
 /// Base constructor for asynchronous command.
 /// </summary>
 /// <param name="canExecute">The implementation of <see cref="ICommand.CanExecute(object)"/>.</param>
 protected AsyncCommandBase(Func <object, bool> canExecute = null)
 {
     _cancelCommand     = new CancelAsyncCommand();
     _canExecute        = canExecute;
     _canExecuteChanged = new WeakCanExecuteChanged(this);
 }
Esempio n. 5
0
 public AsyncCommandEx(Func <T, CancellationToken, Task> command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
 public DelegateAsyncCommand(Func <CancellationToken, Task <T> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 7
0
 public AsyncCommand(Func <Task <TResult> > command, Predicate <object> canExecute)
 {
     _command       = command;
     _canExecute    = canExecute;
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 8
0
 public DelegateCommandEx(Func <object, CancellationToken, Task <T> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 9
0
 public AsyncCommand(Func <Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 10
0
 public AsyncCommand(Func <CancellationToken, Task <TResult> > command)
 {
     _command       = command ?? throw new ArgumentNullException(nameof(command));
     _cancelCommand = new CancelAsyncCommand();
 }
Esempio n. 11
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="canExecute">Can execute predicate</param>
 /// <param name="command">Command</param>
 public AsyncCommand(Predicate <object> canExecute, Func <object, CancellationToken, Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
     _canExecute    = canExecute;
 }
Esempio n. 12
0
 public AsyncCommand(Func <Object, CancellationToken, Task <TResult> > parametrizedCommand)
 {
     _ParametrizedCommand = parametrizedCommand;
     _CancelCommand       = new CancelAsyncCommand();
 }
Esempio n. 13
0
 //TODO: Implement _canExecute in AsyncCommand<TResult>
 public CancellableAsyncCommand(Func <CancellationToken, Task <TResult> > execute, Func <bool> canExecute)
 {
     _cancelCommand = new CancelAsyncCommand();
     _canExecute    = canExecute;
     _execute       = execute;
 }