So, let’s run this and see what we get. We certainly get all the gestures. However, there are the following issues:

1. The DragComplete doesn’t provide any information at all, other than the fact that the drag isn’t taking place anymore

2. The drag works in bursts, so you get many drag events for a single drag

3. The Tap event fires, but a Double Tap doesn’t replace the Tap, so you get both.

There’s a bit of rolling-your-own here. Let’s start with the drag, because it’s actually the easiest problem to solve. We know when the use finishes dragging, so a simple variable to say that they are dragging and where they started will solve most of this problem:

private Vector2? dragStart = null;

Why is it nullable? Well, this variable stores two separate states: whether the user is dragging, and where they started.

Next, we need to know where they were last (if anyone from Microsoft ever reads this, please feel free to give a detailed description in the comments why this hoop jumping is necessary!):

private Vector2? lastPosition = null;

Then we need to store and check these variables; here’s the new section of the switch statement:

That handles the drag. Next, the tap. Handling the Tap is easy, but what if, as I did, you want to handle Tap to do one thing, and Double Tap to do another? This fried my brain for a while; then something occurred to me. What if you delay the action: