WPF Touch操作滚动条,Window弹跳

原文: WPF Touch操作滚动条,Window弹跳

WPF,用ScrollViewer控件,触屏开发,当滑动到最后时会使整个窗体弹跳一下

原因是因为ScrollViewer触屏操作原生支持惯性,ScrollViewer中的内容滚动到边界是会自动触发Window Bounce(窗体弹跳),

以叫做Panning Feedback(拖动回馈)。

欲取消这种效果,办法如下:

1. 转给ScrollViewer注册ManipulationBoundaryFeedback事件

2. 在事件中书写:e.Handled = true;即可。

private void listview_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
{
e.Handled = true;
}

猜你喜欢

转载自www.cnblogs.com/lonelyxmas/p/9402144.html