Example #1
0
 private void SetWeatherList(TempViewModel.RootObject jsonresult)
 {
     if (jsonresult != null)
     {
         _weatherArrayString.Add(jsonresult.name);
     }
 }
Example #2
0
 private void SetWeatherListEvent(TempViewModel.RootObject jsonresult)
 {
     if (jsonresult != null)
     {
         _weather = new WeatherViewModel()
         {
             City    = jsonresult.name,
             Weather = jsonresult.weather[0].description,
             Temp    = string.Format("{0} {1}", jsonresult.main.temp, "°C"),
             TempMax = string.Format("{0} {1}", jsonresult.main.temp_max, "°C"),
             TempMin = string.Format("{0} {1}", jsonresult.main.temp_min, "°C"),
             Url     = $"http://openweathermap.org/img/w/" + jsonresult.weather[0].icon + ".png"
         };
     }
 }