Share via


SearchHandler.OnItemSelected(Object) Method

Definition

Developers may override this method to respond to a search result being selected by the user.

protected virtual void OnItemSelected (object item);
abstract member OnItemSelected : obj -> unit
override this.OnItemSelected : obj -> unit

Parameters

item
System.Object

Remarks

Typically, developers will override this method to navigate to a destination specified by :

protected override async void OnItemSelected(object item)
{
    base.OnItemSelected(item);
    // Note: strings will be URL encoded for navigation (e.g. "Blue Monkey" becomes "Blue%20Monkey"). Therefore, decode at the receiver.
    await (App.Current.MainPage as Xamarin.Forms.Shell).GoToAsync($"app://xamarin.com/xaminals/animals/monkeys/monkeydetails?name={((Animal)item).Name}");
}

Applies to