private void ConfigurationCreatedHandler(string configurationName) { var config = Configuration.Load(); var newConfig = config[configurationName]; ProfileConfigsInternal.Add(new ProfileConfigViewModel(newConfig)); OnPropertyChanged("ProfileConfigs"); }
private void ReloadConfigs() { ProfileConfigsInternal.Clear(); var configuration = Configuration.Load(); foreach (var config in configuration.ProfileConfigurations.Select(x => new ProfileConfigViewModel(x))) { ProfileConfigsInternal.Add(config); } OnPropertyChanged("ProfileConfigs"); }
public void DeleteConfiguration(object parameter) { var config = (ProfileConfigViewModel)parameter; if (MessageBox.Show("Are you sure you want to delete this configuration?", "Confirm Delete", MessageBoxButton.OKCancel, MessageBoxImage.Warning) == MessageBoxResult.OK) { ConfigurationManager.DeleteProfileConfiguration(config.Name); ProfileConfigsInternal.Remove(config); _events.GetEvent <ConfigurationDeletedEvent>().Publish(config.Name); OnPropertyChanged("ProfileConfigs"); } }