public void AddNew() { UserConfigurationViewModel uc = new UserConfigurationViewModel(null); this.Configurations.Add(uc); this.SelectedUserConfiguration = uc; NotifyOfPropertyChange(""); }
public void Delete() { IWindowManager wm = IoC.Get <IWindowManager>(); System.Windows.MessageBoxResult result = wm.ShowMetroMessageBox("If you delete the configuration, all local data will be lost! Delete anyway?", "Delete configuration?", System.Windows.MessageBoxButton.YesNo); if (result == System.Windows.MessageBoxResult.Yes) { UserConfigurationViewModel selCfg = this.SelectedUserConfiguration; this.Configurations.Remove(selCfg); if (this.Configurations.Count > 0) { this.SelectedUserConfiguration = this.Configurations.First(); } this._configuration.UserConfigurations.Remove(selCfg.UserConfiguration); this._configuration.Save(); } NotifyOfPropertyChange(""); }
public void Delete() { IWindowManager wm = IoC.Get<IWindowManager>(); System.Windows.MessageBoxResult result = wm.ShowMetroMessageBox("If you delete the configuration, all local data will be lost! Delete anyway?", "Delete configuration?", System.Windows.MessageBoxButton.YesNo); if (result == System.Windows.MessageBoxResult.Yes) { UserConfigurationViewModel selCfg = this.SelectedUserConfiguration; this.Configurations.Remove(selCfg); if (this.Configurations.Count > 0) { this.SelectedUserConfiguration = this.Configurations.First(); } this._configuration.UserConfigurations.Remove(selCfg.UserConfiguration); this._configuration.Save(); } NotifyOfPropertyChange(""); }