Prevent MouseLeftButtonUp fire when releasing "Hold"?

149 Views Asked by At

I have a ListBox that contains the users favorite stuff. When you click(MouseLeftButtonUp) on an item in the list, you will navigate to "detailspage". If you hold down the listitem it will be deleted. This is performed by the "Hold" event

The problem is that MouseLeftButtonUp will fire when you relese the listitem. Is there a way to prevent the MouseLeftButtonUp to fire? I have seen this behaviour in another app.

1

There are 1 best solutions below

0
On BEST ANSWER

MouseLeftButtonUp will always fire in this case. You need to use a boolean field or similar to test whether it was a short tap or a hold.

To avoid this problem I would recommend using the Tap gesture instead of MouseLeftButtonUp.