public async void GetCategoryApi() { try { //var result = await _webApiRestClient.GetAsync<GetCatApiModel>("getCat"); var result = await _webApiRestClient.GetAsync <GetCatApiModel>("?func=getcat"); setData("CategoryListData", result); ListWidth = App.ScreenWidth; NewCategoryData = new ObservableCollection <HomePageModel>(result.data); var item = new HomePageModel() { CategoryName = "All", CategoryImage = "logo.png", CategorySelected = true }; Application.Current.Properties["PreviousSelectedValue"] = item; NewCategoryData.Insert(0, item); } catch (Exception ex) { UserDialogs.Instance.HideLoading(); UserDialogs.Instance.Alert(ex.Message); } }
private async void getCountryCode() { try { var result = await _webApiRestClient.GetAsync <CountryStatusModel>("getCountryCode"); if (result != null) { countryCodeList.ItemsSource = result.data; } } catch (Exception ex) { await DisplayAlert("Alert", ex.Message, "ok"); } }