private SettingsService() { if (!File.Exists (settingsPath)) { var defaultSettings = new Settings () { HasSeenOnboarding = false, Language = "English", Location = "Berlin" }; var defaultJson = JsonConvert.SerializeObject (defaultSettings); File.WriteAllText (settingsPath, defaultJson); } }
public void PersistSettings(Settings settings) { var settingsJson = JsonConvert.SerializeObject (settings); File.WriteAllText (settingsPath, settingsJson); }