gpt4 book ai didi

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

转载 作者:太空狗 更新时间:2023-10-29 20:41:55 26 4
gpt4 key购买 nike

我在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com