Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
770
Dragdrop exception when changing data source of XamOrgChart
posted

I used Drag & drop framework with XamOrgChart and works fine, but I get an exception if I change ItemsSource of XamOrgChart a second time.

I changed ItemsSource in response of a click on a button, that opens a dialog, do some changes on database, and then reload data and set ItemsSource to reflect changes.

I get a System.NullReferenceException:

en Infragistics.DragDrop.DragDropManager.GetElementWithMouseCapture()    en Infragistics.DragDrop.DragDropManager.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)    en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)    en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)    en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)    en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)    en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)    en System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)    en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)    en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)    en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)    en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)    en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)    en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)    en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)    en System.Windows.Input.InputManager.ProcessStagingArea()    en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)    en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)    en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)    en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)    en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)    en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)    en System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)    en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)    en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)    en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)    en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)    en System.Windows.Window.ShowHelper(Object booleanBox)    en System.Windows.Window.Show()    en System.Windows.Window.ShowDialog()    en GrupoSTRL.MainWindow.cEncargoNuevo_Click(Object sender, RoutedEventArgs e) en d:\Proyectos\GrupoSTRL\Src\GrupoSTRL\MainWindow.xaml.cs:línea 101    en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)    en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)    en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)    en System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)    en System.Windows.Controls.Primitives.ButtonBase.OnClick()    en Infragistics.Windows.Ribbon.ButtonTool.OnClick()    en System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e)    en System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e)    en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)    en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)    en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)    en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)    en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)    en System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e)    en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)    en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)    en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)    en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)    en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)    en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)    en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)    en System.Windows.Input.InputManager.ProcessStagingArea()    en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)    en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)    en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)    en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)    en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)    en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)    en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)    en System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)    en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)    en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)    en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)    en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)    en System.Windows.Threading.Dispatcher.Run()    en System.Windows.Application.RunDispatcher(Object ignore)    en System.Windows.Application.RunInternal(Window window)    en System.Windows.Application.Run(Window window)    en System.Windows.Application.Run()    en GrupoSTRL.App.Main() en d:\Proyectos\GrupoSTRL\Src\GrupoSTRL\obj\Debug\App.g.cs:línea 0    en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)    en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)    en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()    en System.Threading.ThreadHelper.ThreadStart_Context(Object state)    en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)    en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)    en System.Threading.ThreadHelper.ThreadStart()