The MindFusion Forums | |
Flow Diagramming Components >> Bug Reports >> LBC + RBC null ref exception
https://mindfusion.eu/Forum/YaBB.pl?num=1543918992 Message started by lexeranddn on Dec 4th, 2018 at 10:23am |
Title: LBC + RBC null ref exception Post by lexeranddn on Dec 4th, 2018 at 10:23am
we use context menu on Diagram to choose between select and pan mode, and if we clicking quickly LBC + RBC several times we can catch exception, stack trace the following
at MindFusion.Diagramming.Wpf.Diagram.QS(MouseButtonEventArgs K, Point N) at MindFusion.Diagramming.Wpf.Diagram.OnPreviewMouseDown(MouseButtonEventArgs e) at System.Windows.UIElement.OnPreviewMouseDownThunk(Object sender, MouseButtonEventArgs e) at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) 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.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) 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) |
Title: Re: LBC + RBC null ref exception Post by Slavcho on Dec 4th, 2018 at 12:19pm
Try calling diagram.CancelDrag() before showing the context menu. If it doesn't help, please post diagram initialization code and respective event handlers, or attach a test project reproducing that.
|
Title: Re: LBC + RBC null ref exception Post by lexeranddn on Dec 5th, 2018 at 12:16pm
Looks like it helps, thanks!
|
Title: Re: LBC + RBC null ref exception Post by lexeranddn on Dec 5th, 2018 at 1:31pm
I'm sorry, actually it does not work, before I try to make test example:
one more point to reproduce, we declare for diagram dependency property public object MenuItemIsCheckedPan { get => GetValue(MenuItemIsCheckedPanProperty); set => SetValue(MenuItemIsCheckedPanProperty, value); } public static readonly DependencyProperty MenuItemIsCheckedPanProperty = DependencyProperty.Register(nameof(MenuItemIsCheckedPan), typeof(object), typeof(StructureEditor), new PropertyMetadata(null)); and problem is reproducing when this property in true state. |
Title: Re: LBC + RBC null ref exception Post by Slavcho on Dec 6th, 2018 at 8:39am
And what does MenuItemIsCheckedPan do when enabled - does it set diagram.Behavior to Pan?
|
Title: Re: LBC + RBC null ref exception Post by lexeranddn on Dec 6th, 2018 at 2:51pm
Yes, behaviour changes on MouseMove callback
|
Title: Re: LBC + RBC null ref exception Post by Slavcho on Dec 6th, 2018 at 4:28pm
Have you also tried calling CancelDrag from that MouseMove callback?
|
Title: Re: LBC + RBC null ref exception Post by lexeranddn on Dec 7th, 2018 at 10:49am
Great! That works!
|
The MindFusion Forums » Powered by YaBB 2.6.11! YaBB Forum Software © 2000-2024. All Rights Reserved. |