When you set the BaseView.FloatingDocumentContainer property to DocumentsHost, floating documents are hosted within a container to which other documents can be docked. Thus, this floating container contains its own DocumentManager. As a result, if you wish to save layouts of floating documents residing within such a floating container, you need to access their own DocumentManagers. You can do this in the BaseView.RegisterDocumentsHostWindow event handler. Finally, obtain a corresponding View via the DocumentManager.View property, and use its BaseView.SaveLayoutToXml and BaseView.RestoreLayoutFromXml or BaseView.SaveLayoutToStream and BaseView.RestoreLayoutFromStream methods.
This example illustrates how to collect all the Views associated with floating containers, and save and restore their layouts. In short, we create a list of Views where we add a new View in the BaseView.RegisterDocumentsHostWindow event handler. We also delete a View after its floating container is destroyed in the BaseView.UnregisterDocumentsHostWindow event handler.
↧
How to save and restore layouts of floating documents residing within DocumentsHost
↧