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