Exception after re-adding DocumentWindow

Docking/MDI for WPF Forum

Posted 10 years ago by Martin de Jong - Statistics Netherlands
Version: 4.5.0483
Avatar
i received an error on the DocumentWindow.Activate method:

Quote:
System.InvalidOperationException was unhandled
Message="This operation is invalid since the DockingWindow has not yet been registered with a DockSite."
Source="ActiproSoftware.Docking.Wpf30"
StackTrace:
at ActiproSoftware.Windows.Controls.Docking.DockingWindow.Activate(Boolean focus)
at ActiproSoftware.Windows.Controls.Docking.DockingWindow.Activate()
  1. i add programmaticly a DocumentWindow to a TabbedMDIContainer. This works, the tab is added and works.
  2. Then i use the close button (x) of the tab. Document is closed, seems not present anymore in Items etc, so looks ok too.
  3. Then i add a new DocumentWindow with the same name. It creates a new documentWindow, adds this to the items van the TabbedMdicontainer.
    Now i call Activate of the window, and this fails with the above error.

Comments (1)

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

First, you should never add docking windows to objects like TabbedMdiContainer programmatically. Instead you should create the document window, and just call Activate() on it. That will handle proper placement for you. If you add things to the object model programmatically, it could corrupt how DockSite is tracking things.

If you still see the problem after changing your code per above, then please email over a simple sample project that shows it happening and we can take a look.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.