public async void GetForecastAsync(string key)
        {
            var forecast = await WeatherAPI.GetWeatherForecastAsync(key);

            WeatherForecast.DailyForecasts = forecast.DailyForecasts;
            //WeatherForecast = forecast;
        }
        private async void GetCities()
        {
            var cities = await WeatherAPI.GetAutocompleteAsync(Query);

            Cities.Clear();
            foreach (var city in cities)
            {
                Cities.Add(city);
            }
        }
        private async void  GetLocationsAsync()
        {
            Locations.Clear();
            var locations = await WeatherAPI.GetLocationKeyAsync(query);

            foreach (Location location in locations)
            {
                Locations.Add(location);
            }
        }
Beispiel #4
0
        private async void GetCities(string Query)      // Build List of Cities from AutoComplet API call
        {
            Cities.Clear();
            var cities = await WeatherAPI.GetAutocompleteAsync(Query);   //

            foreach (var city in cities)
            {
                Cities.Add(city);
            }
        }
Beispiel #5
0
        public async void GetWeather()
        {
            var weather = await WeatherAPI.GetWeatherInformationAsync(selectedResult.LocationCode);

            Weather.Headline.ForecastText  = weather.Headline.ForecastText;
            Weather.Headline.EffectiveDate = weather.Headline.EffectiveDate;
            Weather.DailyForecastDay1.MaximumTemperature = weather.DailyForecasts[0].Temperature.Maximum.Value.ToString() + " °" + weather.DailyForecasts[0].Temperature.Maximum.Unit;
            Weather.DailyForecastDay1.MinimumTemperature = weather.DailyForecasts[0].Temperature.Minimum.Value.ToString() + " °" + weather.DailyForecasts[0].Temperature.Minimum.Unit;
            Weather.DailyForecastDay1.DayText            = weather.DailyForecasts[0].Day.IconPhrase;
            Weather.DailyForecastDay1.NightText          = weather.DailyForecasts[0].Night.IconPhrase;
        }
        public async void GetWeather()
        {
            if (SelectedResult != null)
            {
                var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedResult.L);

                Weather.Current_Observation.Weather               = weather.Current_Observation.Weather;
                Weather.Current_Observation.UV                    = weather.Current_Observation.UV;
                Weather.Current_Observation.Temperature_String    = weather.Current_Observation.Temperature_String;
                Weather.Current_Observation.Display_Location.City = weather.Current_Observation.Display_Location.City;
            }
        }
Beispiel #7
0
        public async void GetWeather()
        {
            //will initiate null - pending item selection
            var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedResult.Key);

            if (weather.DailyForecasts != null)
            {
                Forecasts.Clear();
                //loop through API received forcasts adding each to Forecast collection
                foreach (var forecast in weather.DailyForecasts)
                {
                    Forecasts.Add(forecast);
                }
            }
        }
Beispiel #8
0
        private async void GetWeather()
        {
            if (!string.IsNullOrEmpty(selectedCity.Key))
            {
                var weather = await WeatherAPI.GetWeatherInformationAsync(selectedCity.Key);

                Weather.DailyForecasts = weather.DailyForecasts;
            }

            Forecasts.Clear();
            if (Weather.DailyForecasts != null)
            {
                foreach (var forecast in Weather.DailyForecasts)
                {
                    Forecasts.Add(forecast);
                }
            }
        }
Beispiel #9
0
        public async void GetWeather()      //Build list of Forecats from API
        {
            Forecasts.Clear();
            if (SelectedResult != null)
            {
                var weather = await WeatherAPI.GetWeatherInformationAsync(SelectedResult.Key);

                if (weather.DailyForecasts != null)
                {
                    foreach (var forecast in weather.DailyForecasts)
                    {
                        Forecasts.Add(forecast);
                    }

                    //TODO: implement radio button to convert forecast values from C to F
                }
            }
        }