Thanks for this example (and especially for your articels on VGB!). However, I would suggest checking for a change in trackingID before updating it in your CustomGestureDetector. I experienced heavy frame rate drops when using your implementation.Changing the method as follows solved it for me:

public void SetTrackingId(ulong id)
{
    if (vgbFrameSource.TrackingId != id)   {
        vgbFrameReader.IsPaused = false;
        vgbFrameSource.TrackingId = id;
        vgbFrameReader.FrameArrived += this.Reader_GestureFrameArrived;
    }
 }