Exemple #1
0
        public async void LoadWeather()
        {
            weatherModel w = new weatherModel();

            try
            {
                var result = await w.LoadWeatherInfo(UserInput);

                clouds = result.clouds.All;
                RaisePropertyChange(nameof(clouds));
                wind = result.wind.Speed;
                RaisePropertyChange(nameof(wind));
                pressure = result.main.Pressure;
                RaisePropertyChange(nameof(pressure));
                humidity = result.main.Humidity;
                RaisePropertyChange(nameof(humidity));
                celsius  = result.main.Temp;
                celsiusv = result.main.Temp;
                RaisePropertyChange(nameof(celsius));
            }
            catch
            {
                MessageBox.Show("City name not found!");
            }
        }
Exemple #2
0
        public weatherMainVM()
        {
            weatherModel model = new weatherModel();

            LoadWeatherCommand = new CommandHandler(LoadWeather, CanExecute);
        }