DockSite.TileDocumentsVertically throws exception

Docking/MDI for WPF Forum

Posted 8 years ago by Peter Cullen
Version: 14.2.0610
Platform: .NET 4.5
Environment: Windows 10 (64-bit)
Avatar

I'm using tabs in my app. I'm aware of at least one customer-reported exception, that I can't reproduce, in which four document windows were open and the DockSite.TileDocumentsVertically command was issued:

"InvalidOperationException: This operation is invalid since the DockingWindow has not yet been registered with a DockSite."

Relevant stack trace:

ActiproSoftware.Windows.Controls.Docking.DockingWindow.Activate(Boolean focus):57
ActiproSoftware.Windows.Controls.Docking.TabbedMdiHost.TileVertically(Int32 maxRowCount):364
ActiproSoftware.Windows.Controls.Docking.TabbedMdiHost.TileVertically():9
ActiproSoftware.Windows.Controls.Docking.DockSite.TileDocumentsVertically():40

Is this a confirmed Actipro bug which has been fixed in a later release? I can't currently upgrade due to project scheduling/risk constraints.

Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Peter,

We're not aware of any bugs in that area.  Looking at the code, I'm not sure how that exception could occur unless you somehow get that particular DockingWindow in the MDI host without first originally registering it with the DockSite.  You need to make sure you always create your docking windows with the constructor that takes a DockSite (as that will register the docking window) or alternatively, you can make sure the docking window has been added to the DockSite.DocumentWindows or ToolWindows collection.  When it is in one of those, it is considered registered.

The only thing that unregisters a docking window on our end is if you have DockSite.AreDocumentWindowsDestroyedOnClose == true.  That will destroy a document window when it's closed, which generally is what you want since a document window's lifetime is usually just while it's visible.  Once a docking window instance has been destroyed (meaning it's been removed from the DocumentWindows or ToolWindows collection), it would need to be re-added to one of those collections before it could be reused again, if that even is a scenario you have in your app.


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.