public PreferencesViewModel(LibrariesSettingsViewModel librariesSettingsViewModel, AdvancedSettingsViewModel advancedSettingsViewModel, GridSettingsViewModel gridSettingsViewModel, IEventAggregator eventAggregator, IUserConfig userConfig) { LibrariesSettingsViewModel = librariesSettingsViewModel; AdvancedSettingsViewModel = advancedSettingsViewModel; _eventAggregator = eventAggregator; MenuViewModels = new ObservableCollection <ISettingsViewModel> { librariesSettingsViewModel, advancedSettingsViewModel, gridSettingsViewModel }; OnPropertyChanged(nameof(MenuViewModels)); OKCommand = new DelegateCommand <ICloseable>(OnOKCommand); CancelCommand = new DelegateCommand <ICloseable>(OnCancelCommand); _userConfig = userConfig; }
private void OnOKCommand(ICloseable window) { LibrariesSettingsViewModel.SaveConfig(); window?.Close(); }