protected override void OnActivate(CancelEventArgs e) { if (settings == null) { settings = new GeneralSettings(); settings.CloneFrom(SettingsService.GetGeneralSettings()); PropertyChangedEventManager.AddHandler(settings, SettingModelPropertyChanged, ""); } else { settings.CloneFrom(SettingsService.GetGeneralSettings()); } }
protected override void OnClosed(EventArgs e) { base.OnClosed(e); var newSettings = SettingsService.GetGeneralSettings(); settings.CloneFrom(newSettings); }
public static void SaveToStorage(GeneralSettings settings) { if (settings == null) { throw new ArgumentNullException("settings"); } SettingsRepository.SaveToStorage(settings, ServiceProvider.GlobalProvider); generalSettingsCache.CloneFrom(settings); }
private void RefreshSettings() { generalSettings.CloneFrom(SettingsService.GetGeneralSettings()); comboModeSettings.CloneFrom(SettingsService.GetComboModeSettings()); }