[英]Tablet WPF Windows Desktop Application - Scrolling issue
我在平板电脑华硕ME400 Intel Atom Z2760上运行我的桌面应用程序WPF。 所有工作都正常,但是当我使用scrollviewer时,用手指在滚动结束时用手指滚动移动(简化平移模式horizontalOnly),窗口移动,你会看到任务栏片刻。 如果我用手指滚动,直到在滚动条中建立后才会看到效果。
我怎么能避免这个窗口运动? 当我在滚动条的末尾滚动时,如何锁定窗口并且不允许移动?
在已启用平移的ScrollViewer
对象中,为ManipulationBoundaryFeedback
注册一个新事件。
<ScrollViewer PanningMode="Both" ManipulationBoundaryFeedback="ScrollViewer_ManipulationBoundaryFeedback">
<!-- your content is here... -->
</ScrollViewer>
在代码隐藏中,您必须通过将Handled
属性设置为true
来处理事件:
void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
{
e.Handled = true;
}
(通过将Handled
属性设置为true
,我们实际上告诉我们事件已由我们处理,因此我们将在Visual Tree中停止消息的冒泡过程,然后才能到达Window
/ Application
- 无论哪个会导致抖动。 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.