private void AutoSuggestBoxFrom_SuggestionChosen(AutoSuggestBox sender, AutoSuggestBoxSuggestionChosenEventArgs args) { // Set sender.Text. You can use args.SelectedItem to build your text string. var selectedText = args.SelectedItem as string; _from = _placesService.GetMatrackPlaces().FirstOrDefault(x => x.Name == selectedText); Suggestions = new ObservableCollection <string>(_placesService.GetMatrackPlaces().Select(p => p.Name)); }
public MainPage() { this.InitializeComponent(); BtnUser.Click += BtnUser_Click; GlobalHelpers globalHelpers = new GlobalHelpers(); _googleMapsApi = new GoogleMapsServices(); _placesService = new PlacesService(); //GoogleMapsServices.Initialize("AIzaSyAPbw5REd81rKh2BE3XbLoazyzKU859qHA"); Suggestions = new ObservableCollection <string>(_placesService.GetMatrackPlaces().Select(p => p.Name)); _requestMatatuResponses = new List <RequestMatatuResponse>(); listResponse.SelectionChanged }