0
votes

I have a ListBox, that has a ContextMenu. I defined an ItemTemplate for the Listbox, and set up an eventhandler for the "OnTap" event. When It fires, I do an action with that. I use the ContextMenu to give the ability to delete / edit an item.

My Problem is the following: If I trigger the context menu via a "long tap" on an Item, It won't be selected in the ListBox, so that I cannot access It. I would like to know, which Item was "long taped". Is there a good practice for that?

Thanks

1
Question 2 answers it from here: windowsphonegeek.com/tips/… Or you can use a self binding ( {Binding} in the Tag of the MenuItem, and get the object that way. Both ways won't require using the deprecated GestureListener.William Melani
Thanks for your Tip, working with GestureListener fits better to My Project.bkotyik

1 Answers

0
votes

Answer is here: http://forums.create.msdn.com/forums/t/85263.aspx

Essentially, use the Silverlight toolkit GestureListener to catch the long hold and then in the event handler, you can look at the DataContext of the sender to get to the proper item.