public static async Task InitializeAsync() { Current = await ApplicationData.Current.LocalSettings.ReadAsync <PomodoroSettings>(SettingsKey); if (Current == null) { Current = new PomodoroSettings(); await SaveAsync(); } if (Current.PomodoroLength == 0) { Current.PomodoroLength = 25; } if (Current.ShortBreakLength == 0) { Current.ShortBreakLength = 5; } if (Current.LongBreakLength == 0) { Current.LongBreakLength = 15; } if (Current.LongBreakAfter == 0) { Current.LongBreakAfter = 4; } }
public static async Task InitializeAsync() { Current = await ApplicationData.Current.LocalSettings.ReadAsync <PomodoroSettings>(SettingsKey); if (Current == null) { Current = new PomodoroSettings { IsNotifyWhenBreakFinished = true, IsNotifyWhenPomodoroFinished = true, BreakAudioUri = string.Empty, PomodoroAudioUri = string.Empty }; await SaveAsync(); } if (Current.PomodoroLength == 0) { Current.PomodoroLength = 25; } if (Current.ShortBreakLength == 0) { Current.ShortBreakLength = 5; } if (Current.LongBreakLength == 0) { Current.LongBreakLength = 15; } if (Current.LongBreakAfter == 0) { Current.LongBreakAfter = 4; } }