public void Dispose() { if (_state != null) { _state.StateChanged -= HandleStateChanged; } if (_configService != null) { _configService.SettingsChanged -= _configService_SettingsChanged; } _inspector?.Dispose(); }