I added mapview using xamarin.forms.maps package. I wanted to add a searchbar field to search address and drop pin using search box.
How to add a SearchBar programmatically a search a location?
I tried the following:
var searchField = new SearchBar
{
Placeholder = "Enter search term"
};
searchField.SearchCommand = new Command(() => { if (searchField != null) { string.Format("Result: {0} is what you asked for.", searchField.Text); }
** // I don't get the text here**
Content = new StackLayout
{
Spacing = 0,
Children = {
searchField,
map,
buttons
}
};