System.ArgumentOutOfRangeException in LayoutAnchorableTabItem.OnMouseEnter line 189 #90
Description
Received following issue:
Top-level Exception Type: System.ArgumentOutOfRangeException Message: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index Source: mscorlib Stack Trace: at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at System.Collections.Generic.List
1.get_Item(Int32 index)
at System.Collections.ObjectModel.Collection1.get_Item(Int32 index) at System.Collections.ObjectModel.ObservableCollection
1.MoveItem(Int32 oldIndex, Int32 newIndex)
at Xceed.Wpf.AvalonDock.Layout.LayoutGroup1.MoveChild(Int32 oldIndex, Int32 newIndex) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Layout\LayoutGroup.cs:line 116 at Xceed.Wpf.AvalonDock.Controls.LayoutAnchorableTabItem.OnMouseEnter(MouseEventArgs e) in F:\MyFiles\CSharp\00_GitHub\Avalondock\source\Components\Xceed.Wpf.AvalonDock\Controls\LayoutAnchorableTabItem.cs:line 189 at System.Windows.UIElement.OnMouseEnterThunk(Object sender, MouseEventArgs e)
Its a sporadic issue, which occurs when there is some load in our application.
We applied a hotfix with prechecking the indexes before executing containerPane.MoveChild
if (newindex < containerPane.ChildrenCount && oldIndex > -1) { containerPane.MoveChild(oldIndex, newindex); }