Esempio n. 1
0
        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;
        }
Esempio n. 2
0
 private void OnOKCommand(ICloseable window)
 {
     LibrariesSettingsViewModel.SaveConfig();
     window?.Close();
 }