/// <summary> /// Navigates to the given settings category, if it is not already the /// current category. /// </summary> /// <param name="targetCategory">Category to attain.</param> public void Navigate(SettingsCategoryEnum targetCategory, bool force = false) { if (CurrentCategory != targetCategory || force) { _currentCategory = targetCategory; if (_contentViewModel != null) { _contentViewModel.Dispose(); } _contentViewModel = GetViewModelByCategory(targetCategory); // Raise a property changed on the whole view model. // Doing so will prevent a temporary mismatch between the // current category and the content view model. RaisePropertyChanged(null); } }
/// <summary> /// Navigates to the given settings category, if it is not already the /// current category. /// </summary> /// <param name="targetCategory">Category to attain.</param> public void Navigate(SettingsCategoryEnum targetCategory, bool force = false) { if (CurrentCategory != targetCategory || force) { _currentCategory = targetCategory; if (_contentViewModel != null) { _contentViewModel.Dispose(); } _contentViewModel = GetViewModelByCategory(targetCategory); // Raise a property changed on the whole view model. // Doing so will prevent a temporary mismatch between the // current category and the content view model. RaisePropertyChanged(null); } }