private void cmdLoadSettings_Click(object sender, RoutedEventArgs e) { OpenFileDialog dlg = new OpenFileDialog(); dlg.Filter = "Settings (*.settings)|*.settings"; bool? result = dlg.ShowDialog(); if (result == true) { SettingsManager mgr = new SettingsManager(); var settings = mgr.LoadSettings(dlg.FileName); LoadSettings(settings); } }
private void cmdSaveSettings_Click(object sender, RoutedEventArgs e) { SaveFileDialog dlg = new SaveFileDialog(); dlg.Filter = "Settings (*.settings)|*.settings"; bool? result = dlg.ShowDialog(); if (result == true) { SettingsManager mgr = new SettingsManager(); var settings = SaveSettings(); mgr.SaveSettings(dlg.FileName, settings); } }