Scrolling/Zoom via Touch in PdfViewWPF control

Hello support,

what is the best way to build in zoom / scrolling via touch in the WPF control?

Best regards

Daniel

Hi Daniel,

This should be implemented already.
set PDFViewWPF.IsManipulationEnabled to true, and it should just work. This is already set on PDFViewWPFTest, so give it a try.

Best Regards,
Tomas Hofmann

Hello,

is there an any way to manipulate the gesture behind the property. We want to support two different gestures. 2-finger-scrolling and Pinch-To-Zoom (2-finger) gestures. When we enabled the property its great that gestures are builded in but we have some textselection and marker tools where the user can celect text with one finger(/pen) and it doesn`t work when we enable this property.

Best regards
Daniel

Hi Daniel,

You can prevent the PDFViewWPF from handling manipulation when you get a touch event by setting e.Handled = true. You can take a look at SimpleShapeCreate to see how we handle it when using touch to draw shapes.

If you want more complex behaviours, such as alllowing selection with 1 finger until 2 fingers touch, at which point you abort and then let the PDFViewWPF handle it, that might be more complex. I don’t think WPF’s manipulation model was designed to really handle this, so please let us know what you really want to do and we will see what we can do to help you.
One way to get your own manipulation events is to host the PDFViewWPF inside another container that can handle manipulation. For example:


Now, when you want to get the manipulation events, you can set PDFViewWPF.IsManipulationEnabled = false and MyManipulationHost.IsManipulationEnabled = true. This should get you access to all the manipulation events.

Please email us if you need help with more detailed work.

Best Regards,
Tomas Hofmann