WPF - Unhandled exception when dragging RadDocumentPane

0 Answers 28 Views
Top achievements
Rank 1
Phillip asked on 06 Jun 2022, 11:14 PM

We have an application that uses the docking mechanism, and have started seeing an exception when dragging the tab for the RadDocumentPane. This is difficult to reproduce but usually happens before the 100th attempt to drag the window (often under 10 attempts). The stack trace doesn't have any of our code in it and I'm stuck trying to understand what the Telerik control is attempting to do. Some help understanding would be useful.

This only seems to happen when attached to a new control (the microsoft automatic graph layout one) that uses a canvas underneath, I'm tempted to wonder whether the resize event is racing with the drag, but I only have a casual model of the Telerik control to try understand what's happening. I'd really just be happy to catch the exception somehow so the user doesn't see it, it doesn't seem to impact any other behaviour

[10:37:52 ERR] Unhandled exception occurred
System.ArgumentNullException: Value cannot be null.
Parameter name: current
   at System.Windows.LogicalTreeHelper.GetParent(DependencyObject current)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.IsLogicalAncestorOf(DependencyObject ancestor, DependencyObject descendant)
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.TryBeginDrag()
   at Telerik.Windows.Controls.InternalWindow.DragBehavior.OnElementMouseMove(Object sender, MouseEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

Dilyan Traykov
Telerik team
commented on 09 Jun 2022, 01:43 PM

Hello Phillip,

I've gone ahead and responded to the identical support ticket you opened on the matter (#1567960). If possible, please let us continue the conversation there to avoid sharing any sensitive information regarding your project publicly and I will then share any useful updates and/or solutions with our community here.
Top achievements
Rank 1
commented on 14 Jul 2022, 12:56 PM

We just had the same crash. Is there any solution/update?
Dilyan Traykov
Telerik team
commented on 19 Jul 2022, 06:51 AM

Hello Christian,

In Philip's particular case, he traced the cause of the exception to the following:

"It looks like the implementation of the input manager means that MouseMove event handler is occasionally called even after it has been unsubscribed, which means that the FinishDrag  method could have executed prior and this explains why the element parameter would be null. This mechanism also explains why this has been difficult to reproduce here.

I believe the FinishDrag method could be happening when the automatic-graph-layout component incorrectly captures the mouse while processing a mouse move event, so an edge case provoked by an error".

With this said, I cannot guarantee whether this same cause is the reason for the exception at your end. If you would demonstrate the exception in a small sample project, I would be more than happy to investigate further. You can also do this in a separate support ticket if you do not wish to share any sensitive data in the forums.

No answers yet. Maybe you can help?

Asked by
Top achievements
Rank 1
Share this question