Exemple #1
0
 public AsyncCommand(Func <CancellationToken, object, Task <TResult> > command, Predicate <object> canExecute)
 {
     this.command    = command;
     this.canExecute = canExecute;
     cancelCommand   = new CancelAsyncCommand();
 }
Exemple #2
0
 public AsyncCommand(Func <CancellationToken, Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Exemple #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);
 }
Exemple #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();
 }
 public AsyncCommand(Func <Task <TResult> > command, Predicate <object> canExecute)
 {
     _command       = command;
     _canExecute    = canExecute;
     _cancelCommand = new CancelAsyncCommand();
 }
Exemple #8
0
 public DelegateCommandEx(Func <object, CancellationToken, Task <T> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
 public AsyncCommand(Func <Task <TResult> > command)
 {
     _command       = command;
     _cancelCommand = new CancelAsyncCommand();
 }
Exemple #10
0
 public AsyncCommand(Func <CancellationToken, Task <TResult> > command)
 {
     _command       = command ?? throw new ArgumentNullException(nameof(command));
     _cancelCommand = new CancelAsyncCommand();
 }
 /// <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;
 }
Exemple #12
0
 public AsyncCommand(Func <Object, CancellationToken, Task <TResult> > parametrizedCommand)
 {
     _ParametrizedCommand = parametrizedCommand;
     _CancelCommand       = new CancelAsyncCommand();
 }
Exemple #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;
 }