-3

I am using ListView from Xamarin.Forms for my project. I have a List<MyObject>, where each object MyObject has an individual URL property. The List is used as the ItemsSource for the ListView. How can I let each list item open the URL it has been assigned to, when clicked on?

taratect
  • 3
  • 1

1 Answers1

0

use the ItemSelected event

protected void ListView_ItemSelected(object sender, SelectedItemChangedEventArgs args)
{
  var item = (MyObject)args.SelectedItem;
  var url = item.Url;

  Device.OpenUri(url);
}
Jason
  • 86,222
  • 15
  • 131
  • 146