[英]Tablet WPF Windows Desktop Application - Scrolling issue
I'm running my desktop application WPF on tablet ASUS ME400 Intel Atom Z2760. 我在平板电脑华硕ME400 Intel Atom Z2760上运行我的桌面应用程序WPF。 All working properly, but when I use scrollviewer, scroll movement with finger (abilitate panning mode horizontalOnly) at the end of scroll with finger, the window moves and you see the taskbar for a moment.
所有工作都正常,但是当我使用scrollviewer时,用手指在滚动结束时用手指滚动移动(简化平移模式horizontalOnly),窗口移动,你会看到任务栏片刻。 The effect is not seen if I scroll with my finger, did not arrive until founded in the scrollbar.
如果我用手指滚动,直到在滚动条中建立后才会看到效果。
How i can avoid this window movement? 我怎么能避免这个窗口运动? How I can lock my windows and do not permit to move when I scroll at the end of scrollbar?
当我在滚动条的末尾滚动时,如何锁定窗口并且不允许移动?
In the ScrollViewer
object, where you've enabled the panning, register a new event for ManipulationBoundaryFeedback
. 在已启用平移的
ScrollViewer
对象中,为ManipulationBoundaryFeedback
注册一个新事件。
<ScrollViewer PanningMode="Both" ManipulationBoundaryFeedback="ScrollViewer_ManipulationBoundaryFeedback">
<!-- your content is here... -->
</ScrollViewer>
In the codebehind, you have to handle the event, by setting the Handled
property to true
: 在代码隐藏中,您必须通过将
Handled
属性设置为true
来处理事件:
void ScrollViewer_ManipulationBoundaryFeedback(object sender, ManipulationBoundaryFeedbackEventArgs e)
{
e.Handled = true;
}
(By setting the Handled
property to true
, we are actually telling that the event has got handled by us, so we are stopping the message's bubbling process in the Visual Tree, before it would reach the Window
/ Application
- whichever would cause the shaking.) (通过将
Handled
属性设置为true
,我们实际上告诉我们事件已由我们处理,因此我们将在Visual Tree中停止消息的冒泡过程,然后才能到达Window
/ Application
- 无论哪个会导致抖动。 )
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.