Exemplo n.º 1
0
        async void getForecast(string cityName)
        {
            ForecastData forecastData = await restService.GetForecastData(GenerateRequestUri(Constants.OpenWeatherMapForecastEndpoint, cityName));

            PageWeather.ForecastData = forecastData;
            MainPageWeather newWether = new MainPageWeather()
            {
                ForecastData = PageWeather.ForecastData,
                WeatherData  = PageWeather.WeatherData
            };

            BindingContext = newWether;
        }
Exemplo n.º 2
0
        public MainPage()
        {
            InitializeComponent();

            PageWeather      = new MainPageWeather();
            App.chosenCities = new List <string>()
            {
                "Paris", "Moscow", "London", "Vladivostok, RU"
            };
            //TODO load chosen city from json
            restService = new RestService();
            getDayWeather(App.chosenCities[0]);
            getForecast(App.chosenCities[0]);
        }