public async void Init(CityWeatherData info) { _imageProvider = DependencyService.Get <IImageProvider>(); SettingsCommand = new Command(OnSettingsButtonClicked); DateTime now = DateTime.Now.ToLocalTime(); TimeSpan t = now - Utilities.GetTime(info.LastUpdateTime); if (t.TotalHours > AppConstants.Values.MAX_UPDATE_TIME_DIFF) { NetworkAdapter nd = new NetworkAdapter(); var dt = await nd.GetCurreentWeatherInfo(info.CityId.ToString()); info = CityWeatherData.FromApiData(dt); } Temperature = string.Format(AppConstants.Strings.CELSIUS_FORMAT, Utilities.KelvinToCelcius(info.Temperature)); City = string.Format(AppConstants.Strings.CITY_FORMAT, info.CityName, info.CountryName); MainWeatherImage = _imageProvider.GetImagePath(App.Database.GetWeatherIcon(info.MainWeatherImageId)); WeatherDescription = info.WeatherInfo; LocalTime = string.Format(AppConstants.Strings.LAST_UPDATE_FORMAT, Utilities.GetFormattedTime(info.LastUpdateTime)); Sunrise = string.Format(AppConstants.Strings.SUNRISE_FORMAT, Utilities.GetFormattedTime(info.SunriseTime)); Sunset = string.Format(AppConstants.Strings.SUNSET_FORMAT, Utilities.GetFormattedTime(info.SunsetTime)); Humidity = string.Format(AppConstants.Strings.HUMIDITY_FORMAT, info.Humidity); Pressure = string.Format(AppConstants.Strings.PRESSURE_FORMAT, info.Pressure); Wind = string.Format(AppConstants.Strings.WIND_FORMAT, info.Wind); }