How to implement long press using manipulation events in windows phone 8?

≯℡__Kan透↙ 提交于 2019-12-13 05:15:08

问题


Since GestureListener is deprecated, we are now left with three events namely ManipulationStarted, ManipulationDelta, ManipulationCompleted.

My custom listbox enables, swiping left and right on listbox items to do certain functions. How do I use the manipulation events to detect long press on a listboxitem? I want to implement the long press in such a way that the swipe left and right is not broken.

Any clue/idea would be of great help!


回答1:


Windows Phone 8 includes a Hold event. Can you sue that for detecting the long press?

If not, you'll need to use a timer within your manipulation events to determine the length of time between starting a manipulation and whether the point of manipulation moves (triggering a delta event) and so suggesting a swipe gesture OR if a delta or completed event is not fired within your defined amount of time then you can assume a long press.



来源:https://stackoverflow.com/questions/18846816/how-to-implement-long-press-using-manipulation-events-in-windows-phone-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!