Two wrong situations that window closed unintended

Docking/MDI for WPF Forum

Posted 6 years ago by Ranye Lu
Version: 14.1.0601
Platform: .NET 4.5
Environment: Windows 8 (64-bit)


I monitor the WindowClosed event of my DockSites to manually dispose the Tool/Document Window and destrory them when the window is closed (the docksite can not automatic destory the window even when the AreDocumentWindowsDestroyedOnClose is set to True).

However, I am facing two additional problems then:

1. If I use the MoveToLinkedDockSite moethod to programatically moving one window to another docksite, the WindowClosed event is triggered and thus the moving window is destoried unintended.

2. If the docksite (child docksite) of a rafting window is docking in a DocumentWindow which is inside a TabbedMdiHost of another docksite (parent docksite), and the TabbedMdiHost of parent docksite has more than one DocumentWindows. If I switch to another DocumentWindow, the WindowClosed event is triggered and the rafting window of the child docksite is destoried unintended.

I think the WindowClosed event should not be triggered in both situations, since the window is not actually asked to be closed.


Comments (3)

Posted 6 years ago by Ranye Lu

For the first problem, I found a work around solution. Use MoveToMdi or others instead of using MoveToLinkedDockSite. This solve my first problem.

However, for the second problem, I can not find a easy work around solution.

Answer - Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA


Could you check the docking window's owner DockSite and see if it is currently loaded (via IsLoaded) or not?  If it's not loaded, that probably means it's been hidden by a parent tab.  So in that case you would know not to dispose the docking windows.

Actipro Software Support

Posted 6 years ago by Ranye Lu

Thanks! It solve my problem.

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