public async Task SaveAsync() { var store = new IsolatedStorage <Settings>(); if (!saving) { saving = true; try { Debug.WriteLine("Saving settings to : " + SettingsFolder); await store.SaveToFileAsync(SettingsFolder, SettingsFileName, this); } finally { saving = false; } } }
public static async Task <Settings> LoadAsync() { var store = new IsolatedStorage <Settings>(); Settings result = null; try { Debug.WriteLine("Loading settings from : " + SettingsFolder); result = await store.LoadFromFileAsync(SettingsFolder, SettingsFileName); } catch { } if (result == null) { result = new Settings(); await result.SaveAsync(); } return(result); }