public void SearchForPlacesAsyncNotFound(GooglePlaceSearchResponse response, GooglePlaceSearchRequest request) { Dispatcher.BeginInvoke(() => { ResultsListSelector.ItemsSource = response.Results; EmptyMessage.Visibility = Visibility.Visible; ResultsListSelector.Visibility = Visibility.Collapsed; }); }
public void SearchForPlaceAync(GooglePlaceSearchRequest searchRequest) { var language = searchRequest.Language.HasValue ? Enum.GetName(typeof(GoogleMapsLanguage), searchRequest.Language.Value).Replace("_", "-") : null; var types = searchRequest.Types == null ? string.Empty : string.Join("|", searchRequest.Types); var requestUrl = string.Format(GooglePlacesAPI_Url, _appId, searchRequest.Sensor.ToString().ToLower(), searchRequest.Keyword); _webRequest = (HttpWebRequest)HttpWebRequest.Create(requestUrl); _webRequest.Method = "Post"; try { _webRequest.BeginGetResponse(ResponseCallback, new List <object> { _webRequest, searchRequest }); } catch (Exception e) { SearchForPlacesAsyncFailed(e.Message, e); } }
private void SearchForPlacesAsyncNotFound(GooglePlaceSearchResponse response, GooglePlaceSearchRequest request) { Dispatcher.BeginInvoke(() => { btnCancel.Visibility = Visibility.Collapsed; btnSearch.Visibility = Visibility.Visible; _progressIndicator.IsVisible = false; EmptyMessage.Visibility = Visibility.Visible; ResultsListSelector.Visibility = Visibility.Collapsed; }); }
private void GooglePlacesSearchForPlaceDelegate(GooglePlaceSearchResponse response, GooglePlaceSearchRequest request) { Dispatcher.BeginInvoke(() => { btnCancel.Visibility = Visibility.Collapsed; btnSearch.Visibility = Visibility.Visible; _progressIndicator.IsVisible = false; ResultsListSelector.ItemsSource = response.Results; EmptyMessage.Visibility = Visibility.Collapsed; ResultsListSelector.Visibility = Visibility.Visible; }); }