
Thank you for reaching out. We looked deeper into the logic used for layout deserialization and unloading/loading of DocumentWindow instances cannot be completely avoided even when only deserializing ToolWindows.
Changes in ToolWindow layouts can affect the overall hierarchy and composition of the DockSite. In some scenarios, this change will result in a DocumentWindow being moved within the DockSite's composition and WPF will then raise the Unloaded/Loaded events. Unfortunately, we cannot prevent this from happening.
A DockingWindow does expose several events you can use to accurately track when a window is opened/closed. You can find details about the various events at the following link:
https://www.actiprosoftware.com/docs/controls/wpf/docking/docking-window-features/docking-window-events
For instance, instead of using the DockingWindow.Loaded event, most DockingWindow code initialization should happen within the "DockSite.WindowsOpening" event. That event fires right before the DockingWindow is opened into the UI.