Skip to content

InvalidCastException when "Loading..." node is selected #3711

@carlreinke

Description

@carlreinke

Steps to reproduce

  1. In the Analyze pane, expand a "Used By" node in the tree. A "Loading..." node appears.
  2. Quickly select the "Loading..." node.

Error message shown

System.InvalidCastException: Object cannot be stored in an array of this type.
   at System.Array.SetValue(Object value, Int32 index)
   at TomsToolbox.Wpf.MultiSelectorExtensions.ArrayCopy(Type elementType, IList source) in D:\a\1\s\src\TomsToolbox.Wpf\MultiSelectorExtensions.cs:line 227
   at TomsToolbox.Wpf.MultiSelectorExtensions.SelectionSynchronizer.Selector_SelectionChanged(Object sender, SelectionChangedEventArgs e) in D:\a\1\s\src\TomsToolbox.Wpf\MultiSelectorExtensions.cs:line 342
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Controls.ListBox.OnSelectionChanged(SelectionChangedEventArgs e)
   at ICSharpCode.ILSpy.Controls.TreeView.SharpTreeView.OnSelectionChanged(SelectionChangedEventArgs e)
   at System.Windows.Controls.Primitives.Selector.SelectionChanger.SelectJustThisItem(ItemInfo info, Boolean assumeInItemsCollection)
   at System.Windows.Controls.ListBox.MakeSingleSelection(ListBoxItem listItem)
   at System.Windows.Controls.ListBox.OnGotKeyboardFocus(Object sender, KeyboardFocusChangedEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)
   at System.Windows.UIElement.Focus()
   at System.Windows.Controls.ItemsControl.FocusItem(ItemInfo info, ItemNavigateArgs itemNavigateArgs)
   at System.Windows.Controls.ListBox.FocusItem(ItemInfo info, ItemNavigateArgs itemNavigateArgs)
   at System.Windows.Controls.ItemsControl.NavigateByLineInternal(Object startingItem, FocusNavigationDirection direction, FrameworkElement startingElement, ItemNavigateArgs itemNavigateArgs, Boolean shouldFocus, FrameworkElement& container)
   at System.Windows.Controls.ItemsControl.NavigateByLine(ItemInfo startingInfo, FrameworkElement startingElement, FocusNavigationDirection direction, ItemNavigateArgs itemNavigateArgs)
   at System.Windows.Controls.ItemsControl.NavigateByLine(FocusNavigationDirection direction, ItemNavigateArgs itemNavigateArgs)
   at System.Windows.Controls.ListBox.OnKeyDown(KeyEventArgs e)
   at ICSharpCode.ILSpy.Controls.TreeView.SharpTreeView.OnKeyDown(KeyEventArgs e)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   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)

Details

  • Product in use: e.g. ILSpy
  • Version in use: 10.0.0.8330+5deb6fb4258a09ba0ff5f63fa6180b1f8d6fb6ad

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions