Пример #1
0
        private async void GetWeather()
        {
            var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedCity.Key);

            Weather.WeatherText         = weather[0].WeatherText;
            Weather.Precipitation       = weather[0].Precipitation;
            Weather.RealFeelTemperature = weather[0].RealFeelTemperature;
            Weather.Temperature         = weather[0].Temperature;
            Weather.CityName            = selectedCity.LocalizedName;
        }
Пример #2
0
        public async void GetWeather()
        {
            var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedCity.Key);

            if (weather.DailyForecasts != null)
            {
                Forecasts.Clear();

                foreach (var forcast in weather.DailyForecasts)
                {
                    Forecasts.Add(forcast);
                }
            }
        }