WPF System.ComponentModel.Win32Exception (0x80004005): Invalid window handle

I get the following error in WPF. I am using MVVM data binding to DataContext + CollectionViewSources in a window. There is too much code in the View Model and View to publish, but I wonder where to look for this, since the line number does not appear.

The window uses WPF data binding with converters, some Telerik controls as well.

This is after a call

TabItemSelectionEditor.UpdateLayout() 

TabItemSelectionEditor is System.Windows.Control.TabItem

System.ComponentModel.Win32Exception (0x80004005): Invalid handle window

at MS.Win32.UnsafeNativeMethods.GetWindowText (HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount)

in System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore ()

in System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree ()

in System.Windows.ContextLayoutManager.fireAutomationEvents ()

in System.Windows.ContextLayoutManager.UpdateLayout ()

in System.Windows.UIElement.UpdateLayout ()

in System.Windows.Controls.VirtualizingStackPanel <. > C_DisplayClassb.b_7 ()

in System.Windows.Threading.ExceptionWrapper.InternalRealCall (Delegate callback, Object args, Int32 numArgs)

in MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen (Object source, delegation method, object arguments, int32 numArgs, delegate catchHandler)

Inner exception is nothing!

+6
source share
1 answer

Don't have a DisplayClass method in your code?

I also see that VirtualizingStackPanel exists, and an error occurred when it called the UIElement.UpdateLayout() method for its children.

What about everything that I can fix from this error and without additional information, I can do nothing more.

0
source

Source: https://habr.com/ru/post/953152/


All Articles