/// <summary> /// Creates an instance with its own implementation of <see cref="ICommand.CanExecuteChanged"/>. /// </summary> protected AsyncCommandBase(Func <object, ICanExecuteChanged> canExecuteChangedFactory) { _canExecuteChanged = canExecuteChangedFactory(this); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }