예제 #1
0
        public async void GetWeather()
        {
            if (SelectedCity.Key != null)
            {
                var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedCity.Key);

                Weather.DailyForecasts.Clear();
                foreach (var item in weather.DailyForecasts)
                {
                    Weather.DailyForecasts.Add(item);
                }
            }
        }
예제 #2
0
        private async void GetCities()
        {
            var cities = await WeatherAPI.GetAutocompleteAsync(CityQuery);

            //var cities = new List<City>
            //{
            //    new City()
            //    {
            //        AdministrativeArea = new Area(),
            //        Country = new Area(),
            //        Key = "111",
            //        LocalizedName = "Testowe miasto 1, Zimbabwe"
            //    },
            //    new City()
            //    {
            //        AdministrativeArea = new Area(),
            //        Country = new Area(),
            //        Key = "111",
            //        LocalizedName = "Testowe miasto 2, Zimbabwe"
            //    },
            //    new City()
            //    {
            //        AdministrativeArea = new Area(),
            //        Country = new Area(),
            //        Key = "111",
            //        LocalizedName = "Testowe miasto 3, Zimbabwe"
            //    }
            //};


            Cities.Clear();
            foreach (var item in cities)
            {
                Cities.Add(item);
            }
        }
        public async void GetWeather()
        {
            var city = SelectedResult.Description.Replace(" ", string.Empty);

            Result = await WeatherAPI.GetWeatherInformationAsync(city);
        }
 private async void GetCities()
 {
     CitySearch = await WeatherAPI.GetAutoCompleteAsync(Query);
 }