为什么 ScrollViewer 在开始滚动时触发 PointerCaptureLost? [英] Why ScrollViewer fired PointerCaptureLost when starting scroll?

查看:29
本文介绍了为什么 ScrollViewer 在开始滚动时触发 PointerCaptureLost?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的 Windows 应用商店应用程序(c#、xaml)中,我有 ScrollViewer,当我放大它并尝试滚动时 - ScrollViewer 触发事件 PointerCaptureLost 并且我无法再处理任何指针事件.
为什么会发生这种情况,以及如何在滚动 ScrollViewer 期间处理指针事件(例如 PointerMoved)?

In my Windows Store App (c#, xaml) I have ScrollViewer, when I zoom in it and trying to scroll - the ScrollViewer fired event PointerCaptureLost and I can't handle any pointers events anymore.
Why it happens, and how I can handle pointers events (for example PointerMoved) during scroll ScrollViewer?

推荐答案

如果没有一些严重的黑客攻击,这似乎是不可能的.

Looks like it may not be possible without some serious hacks.

发生的事情是,每当有导致 FlipView 动画的触摸事件"时,导致该动画的是 FlipView 中内置的 ScrollViewer,用于翻转.滚动查看器会在平移完成之前取消指针输入,并且无法收回.这是一个称为 DirectManipulation 的功能,它现在在单独的线程上处理输入,以提供最平滑的平移处理.(指针 事件在 UI 线程中触发)*

What's happening is that whenever there is "a touch event that causes the FlipView to animate ", the thing that is causing that animation is the ScrollViewer built into the FlipView, used for flipping. The scrollviewer takes away pointer input until the panning has completed and it cannot be taken back. This is a feature called DirectManipulation which is now processing input on a separate thread to give the smoothest possible panning handling. (Pointer events fire in the UI Thread)*

http://social.msdn.microsoft.com/Forums/windowsapps/en-US/1e6732d3-0457-4ddc-b762-963ab974491c/pointerreleased-and-flipview

这篇关于为什么 ScrollViewer 在开始滚动时触发 PointerCaptureLost?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆