private void FilterNames() { string filter = EntrySearch.Text; CountryPickerList.ItemsSource = registerVM.TempCountryPickerListItem.Where(x => x.CountryName.ToLower().Contains(filter.ToLower())); CountryPickerList.EndRefresh(); }
public CountryPickerPopup(RegistrationPageVM _regViewVM) { InitializeComponent(); registerVM = _regViewVM; this.BindingContext = registerVM; CountryPickerList.SetBinding(ListView.ItemsSourceProperty, "TempCountryPickerListItem"); CountryPickerList.ItemSelected += CountryPickerList_ItemSelected; PopUpBgLayout.GestureRecognizers.Add(new TapGestureRecognizer { Command = new Command(HideDialog) }); }
private async void GetCountryDetailApi() { if ((Connectivity.ConnectionProfiles.Contains(ConnectionProfile.WiFi) && Connectivity.NetworkAccess.Equals(NetworkAccess.Internet)) || (Connectivity.ConnectionProfiles.Contains(ConnectionProfile.Cellular) && Connectivity.NetworkAccess.Equals(NetworkAccess.Internet))) { CountryDetailModel response; try { response = await webApiRestClient.GetAsync <CountryDetailModel>(ApiHelpers.GetCountries); } catch (Exception ex) { Console.WriteLine("CountryDetailApi_Exception:- " + ex.Message); response = null; } if (response != null) { if (response.status) { countryDetailData = response.Data; foreach (var data in countryDetailData) { CountryPickerList.Add(data); CountryCodeList.Add(data); } } else { await MaterialDialog.Instance.SnackbarAsync(message : response.message, msDuration : 1000); countryDetailData = null; } } else { await MaterialDialog.Instance.SnackbarAsync(message : AppResource.ServerError, msDuration : 1000); countryDetailData = null; } } else { await MaterialDialog.Instance.SnackbarAsync(message : AppResource.NoInternetError, msDuration : 1000); } }