/// <summary> /// Called when the context has been cancelled. /// </summary> /// <param name="context">The context.</param> private void Notify(RefCountedCancellationTokenSource context) { if (_context != context) { return; } _context = null; _canExecuteChanged.OnCanExecuteChanged(); }
private IDisposable StartOperation() { if (_context == null) { _context = new RefCountedCancellationTokenSource(this); _canExecuteChanged.OnCanExecuteChanged(); } return(_context.StartOperation()); }