/// <summary> /// Creates an instance with its own implementation of <see cref="ICommand.CanExecuteChanged"/>. /// </summary> protected AsyncCommandBase() { _canExecuteChanged = new WeakCanExecuteChanged(this); }
/// <summary> /// Creates a new explicit implementation of <c>ICommand.CanExecuteChanged</c>. /// </summary> /// <param name="sender">The sender of the <c>ICommand.CanExecuteChanged</c> event.</param> public ExplicitCanExecute(object sender) { _canExecuteChanged = new WeakCanExecuteChanged(sender); _threadAffinity = ThreadAffinity.BindToCurrentThread(); }
/// <summary> /// Creates a new cancel command. /// </summary> public CancelCommand() { _cts = new CancellationTokenSource(); _cts.Cancel(); _canExecuteChanged = new WeakCanExecuteChanged(this); }