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?