Let's say I have TouchUp and TouchDown event handlers in a WPF form.
this.TouchDown += window_TouchDown;
this.TouchUp += window_TouchUp;
If I press down two fingers in two different places, each one will fire the TouchDown event. Then if I lift my fingers off in sequence, each one will fire a separate TouchUp event.
The trouble is that in that middle state, when I've lifted one finger off the tablet but one is still pressed down, I've fired a TouchUp event, but it isn't the final TouchUp event that will fire, since one finger is still "down."
What I want to do is capture the "last" TouchUp event, i.e. when the user has stopped touching the tablet completely. I realize I could try to do with with some sort of private int member to count how many touches there are at a time, but that seems hacky to me. I'm hopeful that there is some (boolean?) property on the window to determine if anything is touching it. Is there such a property? How do I accomplish what I'm trying to do?

TouchDeviceproperty on the TouchEventArgs, which has a uniqueIdthat you could track. - Clemens