public async void LoadConditions() { ConditionsList.Clear(); foreach (string key in LocationWeather.Keys) { var condition = await RestService.GetCurrentConditions(key); LocationWeather[key].WeatherConditions = condition.ElementAt(0); ConditionsList.Add(LocationWeather[key]); } SaveLocations(LocationWeather.Values.ToList()); }
private void LoadSettings() { if (Settings.ContainsKey("locations")) { var locationsJson = App.Current.Properties["locations"] as string; var locations = JsonConvert.DeserializeObject <List <LocationWeatherInfo> >(locationsJson); foreach (LocationWeatherInfo item in locations) { LocationWeather.Add(item.Location.Key, item); ConditionsList.Add(item); } } }