c# - Get listview item from image click (UWP) -


i have listview each row has few images , text blocks. if use itemclick event listview, can clicked item (binded object) using this:

private void mainlistview_itemclick(object sender, itemclickeventargs e)     {         var device = (device)e.clickeditem;     } 

but want distinguish between clicks on different elements (images) within listview row. use tapped event imageview (which inside listview) event handler looks this:

private void image_tapped(object sender, tappedroutedeventargs e)     {      } 

how can clicked listview item in case?

you can item data context of tapped element

var fe = sender frameworkelement; var device = fe.datacontext device; 

Comments

Popular posts from this blog

Hatching array of circles in AutoCAD using c# -

ios - UITEXTFIELD InputView Uipicker not working in swift -

Python Pig Latin Translator -