示例#1
0
        public async Task RefreshForecastAsync()
        {
            IsBusy       = true;
            NeedsRefresh = false;

            WeatherInformation.Forecast results = null;

            Forecast.Clear();

            switch (LocationType)
            {
            case LocationType.Location:

                if (Location == null)
                {
                    Location = await LocationHelper.GetCurrentLocationAsync();
                }
                results = await WeatherHelper.GetForecastAsync(Location.Latitude, Location.Longitude);

                break;

            case LocationType.City:
                results = await WeatherHelper.GetForecastAsync(CityName, CountryCode);

                break;
            }



            IsBusy = false;
        }