Microsoft acknowledged the issue:
Gepost门微软运算13/10/2017 OM 11:38
谢谢你报告这一点。 我们意识到这个问题,并正在修复.NET的未来版本。 还有一个相关的问题正在服务修复中发布,这将大大降低打击此问题的可能性。这将很快得到服务。
问题
我们WPF应用程序正在使用触摸(无笔)平板电脑使用,我们正在经历的安装.NET框架4.7后的问题。使用应用程序一段时间后可能会出现两种情况:应用程序完全冻结并且必须重新启动,或者禁用了Popup
或Window
元素中的所有触摸功能。两者之间有相当大的差异,但我相信原因是一样的。
方案1:完全冻结
- 的应用程序变得完全没有响应,应用程序必须使用任务管理器
- 触摸,也可以用鼠标
- 有时以下错误被抛出关闭在应用程序挂起之前:
索引是ou摆脱阵列的界限。
这是堆栈跟踪:
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at System.Windows.Input.StylusWisp.WispLogic.CoalesceAndQueueStylusEvent(RawStylusInputReport inputReport)
at System.Windows.Input.StylusWisp.WispLogic.ProcessSystemEvent(PenContext penContext, Int32 tabletDeviceId, Int32 stylusDeviceId, Int32 timestamp, SystemGesture systemGesture, Int32 gestureX, Int32 gestureY, Int32 buttonState, PresentationSource inputSource)
at System.Windows.Input.PenContext.FireSystemGesture(Int32 stylusPointerId, Int32 timestamp)
at System.Windows.Input.PenThreadWorker.FireEvent(PenContext penContext, Int32 evt, Int32 stylusPointerId, Int32 cPackets, Int32 cbPacket, IntPtr pPackets)
at System.Windows.Input.PenThreadWorker.ThreadProc()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
方案2:部分冻结
- 主窗口仍然响应(通过鼠标和触摸),但任何 '覆盖' 内容(模态对话框,
Window
,Popup
元素,来自DatePicker
,ComboBox
,...)不响应轻拍。应用程序必须重新启动才能重新启用触摸。 - 鼠标仍可用于“叠加”元素。
此问题也在详细解释here。 问题发生后的行为视频可以找到here。
附加信息
- 这两种情况都可以模拟不同类型的片,并且还在Windows模拟器,使用Windows 8.1和Windows 10的混合。
- 当删除.NET Framework 4.7时,问题得到解决。
- 通过用多个手指快速点击某些
ComboBox
元素,可以轻松地再现场景2。几分钟后,弹出窗口不再响应触摸。 - 情景1很难模拟,并且随机发生。
原因
这个问题似乎有事情做与StylusWisp代码。我想它突然失败,并在那之后变得无法使用。
使用DisableWPFTabletSupport或DisableStylusAndTouchSupport禁用触笔支持时,问题消失。但是,任何ScrollViewer
与PanningMode="Both"
不能再被滑动滚动。
解决方案?
A similar issue已报告给Microsoft。由于目前还没有太多支持,修复可能需要一段时间。与此同时,我正在寻找一个针对此问题的解决方案,即不涉及禁用.NET Framework 4.7并保持原始触摸支持完好。有没有人有相同的问题和更好的解决方案?