Exemple #1
0
 /// <summary>
 /// Creates an instance with its own implementation of <see cref="ICommand.CanExecuteChanged"/>.
 /// </summary>
 protected AsyncCommandBase(Func <object, ICanExecuteChanged> canExecuteChangedFactory)
 {
     _canExecuteChanged = canExecuteChangedFactory(this);
 }
Exemple #2
0
 /// <summary>
 /// Creates a new cancel command.
 /// </summary>
 /// <param name="canExecuteChangedFactory">The factory for the implementation of <see cref="ICommand.CanExecuteChanged"/>.</param>
 public CancelCommand(Func <object, ICanExecuteChanged> canExecuteChangedFactory)
 {
     _canExecuteChanged = canExecuteChangedFactory(this);
 }
Exemple #3
0
 /// <summary>
 /// Creates an instance with its own implementation of <see cref="ICommand.CanExecuteChanged"/>.
 /// </summary>
 protected AsyncCommandBase(Func <object, ICanExecuteChanged> canExecuteChangedFactory)
 {
     _ = canExecuteChangedFactory ?? throw new ArgumentNullException(nameof(canExecuteChangedFactory));
     _canExecuteChanged = canExecuteChangedFactory(this);
 }
Exemple #4
0
 /// <summary>
 /// Creates a new cancel command.
 /// </summary>
 /// <param name="canExecuteChangedFactory">The factory for the implementation of <see cref="ICommand.CanExecuteChanged"/>.</param>
 public CancelCommand(Func <object, ICanExecuteChanged> canExecuteChangedFactory)
 {
     _ = canExecuteChangedFactory ?? throw new ArgumentNullException(nameof(canExecuteChangedFactory));
     _canExecuteChanged = canExecuteChangedFactory(this);
 }
Exemple #5
0
 /// <summary>
 /// Creates a new cancel command.
 /// </summary>
 /// <param name="canExecuteChangedFactory">The factory for the implementation of <see cref="ICommand.CanExecuteChanged"/>.</param>
 public CancelCommand(Func <object, ICanExecuteChanged> canExecuteChangedFactory)
 {
     _cts = new CancellationTokenSource();
     _cts.Cancel();
     _canExecuteChanged = canExecuteChangedFactory(this);
 }