Is it possible to determine the "RaftingWindow - DockingWindowCloseReason"?

Docking/MDI for WPF Forum

Posted 7 years ago by Geir Schjorlien
Version: 11.2.0554
Avatar

Hi,

I have an application where the user can create multiple document windows. These windows may be in either Floating or Docked state (my DockSite has "UseHostedRaftingWindows=false"). I need to do some cleanup when the user closes such a window, and to do this I'm using the DockSite.WindowClosed event. This works fine.

In addition, this application is module-based meaning that the user by clicking a menu-button, may replace the entire GUI. We use Prism for this - basically I just "unload" a user-control containing the current DockSite and replace with another. This also works fine.

If the user has one or more document-windows in floating state when changing module, my DockSite.WindowClosed event-handler gets called which is also as expected, but I would like to know the reason for the "WindowClosed".

So finally my question: I know you have a DockingWindowCloseReason passed to the RaftingWindow.Close method. Is it possible to hook in somewhere so that I can determine if the window was closed by the user or closed because the DockSite was unloaded?

 

Geir

Comments (1)

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

Hi Geir,

Sorry but we just use that reason internally and it's not exposed anywhere.  Your best bet would be to set some sort of flag somewhere, such as on the DockSite via an attached property when you know that you are manually unloading everything.  Then check that flag in your WindowClosed handler.


Actipro Software Support

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