WPF - StylusLogic - 索引超出范围

时间:2013-06-13 15:39:35

标签: c# wpf touch argumentexception

我有一个WPF应用程序,有几个人使用,有时我收到一封有这个错误的电子邮件,但我无法重现它。任何人都知道该怎么做才能得到这个错误?

at System.ThrowHelper.ThrowArgumentOutOfRangeException()
   at System.Collections.Generic.List`1.get_Item(Int32 index)
   at System.Windows.Input.StylusLogic.PromoteStoredItemsToMouse(StylusTouchDevice touchDevice)
   at System.Windows.Input.StylusTouchDevice.OnManipulationEnded(Boolean cancel)
   at System.Windows.Input.TouchDevice.System.Windows.Input.IManipulator.ManipulationEnded(Boolean cancel)
   at System.Windows.Input.ManipulationDevice.OnManipulationCancel()
   at System.Windows.Input.ManipulationDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.ManipulationDevice.ProcessManipulationInput(InputEventArgs e)
   at System.Windows.Input.ManipulationLogic.ReportFrame(ICollection`1 manipulators)
   at System.Windows.Input.ManipulationDevice.ReportFrame()
   at System.Windows.Input.ManipulationDevice.RemoveManipulator(IManipulator manipulator)
   at System.Windows.Input.Manipulation.TryRemoveManipulator(UIElement element, IManipulator manipulator)
   at System.Windows.Input.TouchDevice.PromoteMainToManipulation(UIElement manipulatableElement, TouchEventArgs touchEventArgs)
   at System.Windows.Input.TouchDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.TouchDevice.RaiseLostCapture(IInputElement oldCapture)
   at System.Windows.Input.TouchDevice.Capture(IInputElement element, CaptureMode captureMode)
   at System.Windows.Input.TouchDevice.PromoteMainToManipulation(UIElement manipulatableElement, TouchEventArgs touchEventArgs)
   at System.Windows.Input.TouchDevice.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.TouchDevice.RaiseTouchUp()
   at System.Windows.Input.TouchDevice.ReportUp()
   at System.Windows.Input.StylusLogic.PromoteMainUpToTouch(StylusDevice stylusDevice, StagingAreaInputItem stagingItem)
   at System.Windows.Input.StylusLogic.PromoteMainToTouch(ProcessInputEventArgs e, StylusEventArgs stylusEventArgs)
   at System.Windows.Input.StylusLogic.PromoteMainToOther(ProcessInputEventArgs e)
   at System.Windows.Input.StylusLogic.PostProcessInput(Object sender, ProcessInputEventArgs e)
   at System.Windows.Input.InputManager.RaiseProcessInputEventHandlers(ProcessInputEventHandler postProcessInput, ProcessInputEventArgs processInputEventArgs)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.StylusLogic.InputManagerProcessInput(Object oInput)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Methode:             Void ThrowArgumentOutOfRangeException()

1 个答案:

答案 0 :(得分:0)

鼠标输入正常但Touch会导致此异常。在我的情况下,禁用RealTimeStylus似乎修复了这个特殊问题。

请参阅http://referencesource.microsoft.com/#PresentationCore/Core/CSharp/System/Windows/Input/Stylus/StylusTouchDevice.cs

取自相关问题,该问题具有类似的堆栈跟踪但由RealTimeStylus引起的异常异常。 https://stackoverflow.com/a/15879522/3304592