Пример #1
0
        private async Task LoadWeatherAsync(IEnumerable <City> cities)
        {
            var service = new OpenWeatherMapService();
            List <WeatherForecast> forecast = new List <WeatherForecast>();

            foreach (var cityFollowed in cities)
            {
                var weather = await service.GetCurrentWeatherByCityAsync(cityFollowed);

                forecast.Add(weather);
            }
            Forecast.ItemsSource = forecast;
        }