public void Deactivate(bool close) { AttemptingDeactivation.Raise(this, new DeactivationEventArgs { WasClosed = close }); if (_disposeToken != null && close) { _disposeToken.Dispose(); } IsActive = false; OnDeactivate(close); Deactivated.Raise(this, new DeactivationEventArgs { WasClosed = close }); }