ScrollViewer PointerWheelChanged event stops firing when content is larger #9582
brookslindseyjr
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
ScrollViewer.PointerWheelChanged
In my simple test project I have a Rectangle placed inside a ScrollViewer. When I use the mouse wheel and the rectangle is smaller than the ScrollViewer, the PointerWheelChanged event gets fired. When the rectangle is larger than the ScrollViewer, PointerWheelChanged is not fired. The same is true when I use the Track Pad, where pinch to zoom is enabled.
I can get PointerWheelChanged to fire always when CTRL is also being held down when using the mouse wheel, whether the rectangle is large or small. The problem is that the Track Pad does not respond like this. When the rectangle is bigger, Track Pad will not fire PointerWheelChanged even if I'm holding down CTRL (because it looks like CTRL is always sent with the track pad pinch zoom). Is there a way to easily change this behavior?
Example usage:
If I load an image to the ScrollViewer and the user is using only the mouse, I can use the PointerWheelChanged (plus a KeyModifier check for CTRL) event to let the user pan up and down, and when they hold CTRL down, zoom in and out. This works great!
When the user uses the Track Pad to two-finger pan up and down, that's built in and works. When they zoom, as soon as the content is larger than the scroll, pinch to zoom is totally disabled, as the panning mode is now enabled. How can I handle this?
WinUI3Windows.zip
Beta Was this translation helpful? Give feedback.
All reactions