9

I'm getting the following error on WPF. I'm using MVVM databinding to DataContext + CollectionViewSources on the Window. There is too much code in the View Model and View to post, but I'm wondering where to look to find this as no line number comes up.

The window is using WPF databinding with converters, some Telerik controls in there also.

This is after calling

TabItemSelectionEditor.UpdateLayout() 

TabItemSelectionEditor is a 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)

Inner Exception is nothing!

DermFrench
  • 3,968
  • 13
  • 43
  • 70
  • Anything else to go on--there's really not much there even to guess at. That seems like the stack for handling the exception--not the stack that caused the exception. Is there an inner exception? What *that* the inner exception? – Peter Ritchie Sep 04 '13 at 12:49
  • I've just added a few more details. – DermFrench Sep 04 '13 at 12:49
  • 2
    I'm seeing a very problem and I have no idea where this is coming from: Type: System.ComponentModel.Win32Exception Message: Cannot create a file when that file already exists StackTrace: at MS.Win32.UnsafeNativeMethods.GetWindowText(HandleRef hWnd, StringBuilder lpString, Int32 nMaxCount) at System.Windows.Automation.Peers.WindowAutomationPeer.GetNameCore() ... at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) – Volker von Einem Mar 25 '14 at 16:51
  • I am seeing exactly same exception as @Volker von Einem. I have no idea why. Anyone has a clue? – lot Nov 04 '14 at 09:07

1 Answers1

0

Do you not have a DisplayClass method in your code?

I can also see that there is a VirtualizingStackPanel involved and the error occurred when it called the UIElement.UpdateLayout() method on its children.

That's about all that I can work out from this error and without any more information, I can't help any further.

Sheridan
  • 68,826
  • 24
  • 143
  • 183
  • I have a .Show() method on my ViewModel, which created the view and displays it. Is this what you mean by a DisplayClass method? – DermFrench Sep 04 '13 at 12:57
  • Nope. It was just a guess, but you're saying that you have no class, method, or custom object called `DisplayClass` anywhere in the application? It was because of the line in the error where it says `DisplayClass`... this is *not* a method of the `VirtualizingStackPanel` class, so I assumed that it was from *your* code. – Sheridan Sep 04 '13 at 13:08
  • Maybe that is in the Telerik code? As I'm using some Telerik stuff inside that Tab Item. – DermFrench Sep 04 '13 at 13:14
  • It could well be from Telerik... maybe you should contact them? – Sheridan Sep 04 '13 at 13:23
  • Hey I removed Telerik and switched to built in .NET WPF TabControl and same issue. – DermFrench Sep 04 '13 at 16:24