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
120
ArgumentOutOfRangeException when updating XamDiagram
posted

In my project I have an ObservableCollection of nodes and an ObservableCollection of associations. The data for the nodes/associations can be edited as well as added/removed in other tabs in the same window. If the user edits one node and returns to the diagram tab everything works perfectly. However, if multiple changes are made the result is "Index was out of range. Must be non-negative and less than the size of the collection."

I created an example app. It's crude and doesn't work entirely the same as my project, but I was able to repeat the issue.

In the example app, to replicate the issue: Click "Generate Diagram", then click on the "XDiagram" tab, click back to the "DefaultTab" and click "ChangeNode" more than once, once you click back to the "XDiagram" tab the app should crash with an ArgumentOutOfRangeException.

Note: The "ChangeNode" button removes a node then re-adds a node. If only done once before switching back to the "XDiagram" tab, everything works successfully. Also, the app crashes before the OnLoad function for the "XDiagram" tab is called.

Attached is both the stack-trace and the example app.

XamDiagramStackTrace.txt
System.ArgumentOutOfRangeException
  HResult=0x80131502
  Message=Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
  Source=mscorlib
  StackTrace:
   at System.Collections.ArrayList.RemoveAt(Int32 index)
   at Infragistics.Controls.Charts.BoundsManager.RemoveBoundsIndexesRange(IList`1 orderedIndexes, EdgeType edgeType)
   at Infragistics.Controls.Charts.BoundsManager.RemoveBoundsIndexesRange(IList`1 boundIndexesItems)
   at Infragistics.Controls.Charts.XamDiagram.InitializeBoundsValues()
   at Infragistics.Controls.Charts.XamDiagram.ArrangeDiagram()
   at Infragistics.Controls.Charts.XamDiagram.ArrangeOverride(Size arrangeBounds)
   at System.Windows.FrameworkElement.ArrangeCore(Rect finalRect)
   at System.Windows.UIElement.Arrange(Rect finalRect)
   at System.Windows.ContextLayoutManager.UpdateLayout()
   at System.Windows.UIElement.UpdateLayout()
   at Infragistics.Windows.DockManager.ContentPane.ActivateInternalImpl(Boolean force, Boolean bringIntoView, Boolean restoreMinimizedToolWindow)
   at Infragistics.Windows.DockManager.ContentPane.ActivateInternal(Boolean force, Boolean bringIntoView, Boolean restoreMinimizedToolWindow)
   at Infragistics.Windows.DockManager.PaneTabItem.OnMouseDown(MouseButtonEventArgs e)
   at System.Windows.UIElement.OnMouseDownThunk(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.ContentElement.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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Application.RunDispatcher(Object ignore)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run(Window window)
   at System.Windows.Application.Run()
   

XamDiagram.zip

Parents
No Data
Reply
  • 28945
    Offline posted
    Hello,
    Thank you for contacting Infragistics. I've reproduced and isolated the behavior and I've logged a development issue (# 260719) with our developers to investigate this further and opened a private case ( CAS-200114-M0N0N5 ) to provide you with further updates regarding our investigation. You may visit the case from the support activities section > In development tab from your account.
    Let me know if you have any questions. 
Children
No Data