我正在tablet ME400 Intel Atom Z2760上运行我的桌面应用程序WPF。所有操作都正常,但是当我使用滚动查看器时,用手指滚动移动(能够使用摇摄模式horizontalOnly)在用手指滚动结束时,窗口会移动,然后您就会看到任务栏。如果我用手指滚动效果是看不出来的,直到我在滚动条中创建后才到达。
我怎么才能避免窗户的移动?当我在滚动条的末尾滚动时,我怎么能锁定我的窗口而不允许移动呢?
发布于 2016-05-03 09:25:18
在启用摇摄的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__,我们实际上是在告知事件已由我们处理,因此在消息到达true__之前,我们将在Visual中停止消息的冒泡过程--以引起震动的因素为准)。
https://stackoverflow.com/questions/16126400
复制相似问题