4
Vote

8255-PinchDelta not working in WP8

description

I have updated my working project from with phone toolkit from 80797 to 85255. After update, the pinch zoom did not work any longer. Seems that the PinchDelta is no longer fired. Or at least almost never. Noticed that when keep on trying pinch, sometimes the PinchDelta is fired, seems randomly

When debugging, saw that the following code is called, when starting pinch:

// Start the pinch
                RaiseGestureEvent(
                    (handler) => handler.PinchStarted,
                    () => new Microsoft.Phone.Controls.PinchStartedGestureEventArgs(originalPrimary, originalSecondary, currentPrimary, currentSecondary),
                    true);
But the following code not

// Continue the pinch
                RaiseGestureEvent(
                    (handler) => handler.PinchDelta,
                    () => new Microsoft.Phone.Controls.PinchGestureEventArgs(originalPrimary, originalSecondary, currentPrimary, currentSecondary),
                    false);
and oldState is "GestureState.Undetermined" after starting pinch which might be the reason for not callin gthe PinchDelta


Did not have time to fully debug and find a possible cause/solution for the error

Noticed that in this build the following files are now different from the WP7 version:

GestureListenerStatic.cs
GestureService.cs

I removed these files from the WP8 project and linked to the WP7 project files. Pinch zoom is now working in the WP8 phone project.

comments

XRayAdamo wrote Jun 20, 2013 at 12:32 PM

Same here. It works only firs time, but stopped work after that. I have an app which shows image and allows to pinch to zoom.

Necroman wrote Jun 20, 2013 at 9:38 PM

Same here, the new GestureListener implementation is broken and we had to use backported implementation from the previous version. I could create simple reproduction scenario, but in short, it's not accepting any gesture events in the right half of the screen when in horizontal mode (I guess the listener works only on left 480px, both in horizontal and vertical orientation).

bdlou wrote Aug 24, 2013 at 4:06 PM

This must be what I'm running in to, as this is the first time I've tried to use the GestureService in the toolkit. I have an app running in Horizontal orientation. The events are always fired on the left side of the screen, but never on the right side of the screen (I was using Flick and DragCompleted). At the time, I thought it had to do with the controls that are on the right side of the screen (TextBlocks and Buttons), however now that I've found this thread, I realize the gestures work if I do them on those controls towards the center of the screen.

bdlou wrote Aug 24, 2013 at 4:41 PM

Oh... GestureService was deprecated in 2011:
http://www.jeff.wilcox.name/2011/11/nov2011phonetoolkit/

So, stop using that I guess. :)

uxadditives wrote Sep 7, 2013 at 10:01 AM

@bdlou

Well, the point is that the deprecated GestureService is working for the pinch zoom in WP8, but the new GestureListener implementation is broken.