public BaseModel(IWeatherService service, INavigationService navService, IDialogService DialogService) { Progress = true; corf = false; BtnContent = "C or F"; this.dataService = service; this.navigationService = navService; this.dialogService = DialogService; CurrentTemps = new ForecastModel.RootObject(); CityList = new ObservableCollection <City>(); GetForecastWeather("istanbul"); }
private async Task GetForecastWeather(string value) { try { Progress = true; CurrentTemps = await dataService.GetForecast(value); Title = CurrentTemps.location.name; Icon = CurrentTemps.current.condition.icon; Temp = CurrentTemps.current.temp_c.ToString() + " °C"; ForecastList = CurrentTemps.forecast.forecastday; } catch (Exception ex) { //await dialogService.ShowMessage(ex.Message, "Notice"); } finally { Progress = false; } }