简体   繁体   English

平板电脑WPF Windows桌面应用程序 - 滚动问题

[英]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时,用手指在滚动结束时用手指滚动移动(简化平移模式horizo​​ntalOnly),窗口移动,你会看到任务栏片刻。 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.

相关问题 WPF应用程序可以在Windows 8平板电脑上工作吗? - WPF application work on windows 8 tablet? Windows 8平板电脑上WPF应用程序的性能 - Performance of WPF Application on Windows 8 tablet Windows 8 Pro平板电脑上的WPF Windows客户端应用程序 - WPF windows client application on windows 8 pro tablet WPF桌面应用程序将无法在Windows 10中启动 - WPF Desktop Application Will not start in Windows 10 Windows 10上的WPF应用程序问题 - WPF application issue on Windows 10 如何使用Windows窗体应用程序(非WPF)访问Windows平板电脑上的相机或连接的网络摄像机? - How to access camera on a windows tablet or attached web cams using Windows Form Application (Not WPF)? WPF应用程序在锁定窗口并恢复到桌面后变黑 - WPF application black after locking windows and resume to desktop 如何在 Windows 10 桌面应用程序中隐藏 WPF 中的任务栏? - How do you hide the taskbar in WPF in a Windows 10 Desktop application? 如何在使用 WPF 或 Windows Forms 构建的桌面应用程序中实施广告? - How to implement Ads in Desktop Application built with WPF or Windows Forms? 在 Windows 桌面应用程序中通过 OpenGL 窗口显示 WPF 控件 - Display WPF controls over OpenGL window in Windows desktop application
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM