Is there a way to touch-enable scrolling in a WPF ScrollViewer?

后端 未结 2 1533
野性不改
野性不改 2020-12-24 01:02

I\'m trying to create a form in a WPF application that will allow the user to use iPhone-like gestures to scroll through the available fields. So, I\'ve put all my form cont

2条回答
  •  清歌不尽
    2020-12-24 01:28

    You should use the attached properties:

    • ScrollViewer.PanningMode
    • ScrollViewer.PanningDeceleration
    • ScrollViewer.PanningRatio

    The PanningMode defaults to None in the ScrollViewer default style, but setting it to another value will enable touch scrolling. I'm currently investigating using this feature in my app and am looking for a good deceleration and ratio value... I'll probably just have to test them out to find something that works well.

提交回复
热议问题