Hi Anson,
We would like to you can get the item index of the item on a button, you can get the selected item object in the ViewModel by the Tapped command, and from there you can get the index, Please refer to the below sample and code snippet for more reference.
Code snippet:
private
void buttonTapped(object obj) { TappedItem
= obj as Contacts; var index =
DataSource.DisplayItems.IndexOf(TappedItem); Application.Current.MainPage.DisplayAlert("Alert",
"Item Tapped "+index, "Ok"); } |
Please let us know if you have any concern
Regards,
Suthi Yuvaraj.
Attachment:
ListViewXamarin_1cabc526.zip