public override void Dispose() { if (_state == State.Disposed) { return; } _state = State.Disposed; if (_subscription is object) { var sub = _subscription; _subscription = null; sub.Dispose(); } else if (IsActive) { if (_styledProperty is object) { _target.ClearValue(_styledProperty); } else { _target.ClearValue(_directProperty !); } } base.Dispose(); }
public override void Dispose() { if (_subscription is not null) { var sub = _subscription; _subscription = null; sub.Dispose(); } else if (_isActive) { if (_styledProperty is not null) { _target.ClearValue(_styledProperty); } else { _target.ClearValue(_directProperty !); } } base.Dispose(); }