我在 WPF 上收到以下错误。 我正在使用 MVVM 数据绑定(bind)到窗口上的 DataContext + CollectionViewSources。 View Model 和 View 中的代码太多无法发布,但我想知道在哪里可以找到它,因为没有行号出现。
该窗口使用带有转换器的 WPF 数据绑定(bind),其中还有一些 Telerik 控件。
这是在调用之后
TabItemSelectionEditor.UpdateLayout()
TabItemSelectionEditor 是一个 System.Windows.Control.TabItem
System.ComponentModel.Win32Exception (0x80004005): Invalid window handle
at MS.Win32.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount)
at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore()
at System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
at System.Windows.ContextLayoutManager.fireAutomationEvents()
at System.Windows.ContextLayoutManager.UpdateLayout()
at System.Windows.UIElement.UpdateLayout()
at System.Windows.Controls.VirtualizingStackPanel.<>c_DisplayClassb.b_7()
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
内部异常不算什么!
最佳答案
您的代码中没有 DisplayClass
方法吗?
我还可以看到,有一个 VirtualizingStackPanel
涉及,当它在其子项上调用 UIElement.UpdateLayout()
方法时发生错误。
这就是我可以从这个错误中解决的所有问题,没有任何更多信息,我无法提供任何进一步的帮助。
关于c# - WPF System.ComponentModel.Win32Exception (0x80004005) : Invalid window handle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18614011/