Adding document windows, re-add fail.

Docking/MDI for WPF Forum

Posted 9 years ago by horhalau
Version: 9.2.0507
Avatar
I have this :

<docking:DockSite Name="dockSite">
    <docking:TabbedMdiHost>
        <docking:TabbedMdiContainer Name="TabbedMDIC" >
                    
        </docking:TabbedMdiContainer>
    </docking:TabbedMdiHost>
</docking:DockSite>

//Adding a new document window
DocumentWindow docuWindow = new DocumentWindow(dockSite1);
TabbedMDIC.Items.Add(docuWindow);
docuWindow.Activate();
When I add a document window, it works, but when i close all open document windows and re-add another, Activate() throws "This operation is invalid since the DockingWindow has not yet been registered with a DockSite."

I've checked some solutions in other similar threads but none worked.

What would be the issue ?

Thank you

Comments (1)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Note that DocumentWindows will by default "destroy" themselves when closed. Destroy means that they remove their DockSite affiliation. If you want to be reusing DocumentWindow instances after they are closed (more like ToolWindows), then you need to set DockSite.AreDocumentWindowsDestroyedOnClose to false.

Alternatively you can call dockSite.DocumentWindows.Add(yourDocumentWindow) before calling Activate(). That will re-register it.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) 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.