I saw here and in some articles that I should use GestureListener to get Tap from user then use SelectionChanged. I tried it and I like it. But I have problem with it. When my listbox moves (scrolls) and I try tap I get bad item (I get item from last tap). When I scroll and wait for stopping scroll and then tap everything is fine (I get exactly item which I tap on). Anyone else with this problem? Any solution? Thanks
Share
As (according to your tags) you’re targetting 7.1, there is no need to have to use a
GestureListenerto detectTapevents.All UIElements in Silverlight 4 (which 7.1 is based on) support a built in
Tapevent. See http://msdn.microsoft.com/en-us/library/system.windows.uielement.tap(v=vs.95).aspxUsing a
GestureListenerhas an unnecessary performance overhead and can cause other issues as you’re discovering.You should use a
Tapevent in the individualListBoxItems or theSelectionChangedevent on theListBoxnot both.If you create a new Databound Application, the code in the default project files will show an example of how to use
SelectionChangedand in that instance trigger a page navigation.In future, you may also get a better, faster answer by showing the code you are having problems with, not just describing it.