Some of DockLayoutManager’s panel groups can contain documents that were created from ViewModel with IDocumentManagerService. To serialize and restore them correctly, it is necessary to perform the following steps.
Item names are used to identify items when saving/restoring the layout. For this reason, it will be necessary to set unique names for all DockLayoutManager panels. In the current scenario, this can be done by setting the DocumentPanel.BindableName property in the TabbedDocumentUIService.DocumentPanelStyle.
Another important point is that the DockLayoutManager's saving/restoring mechanism is not the XamlWriter alternative - it does not save/restore content of its panels. It will be necessary to additionally restore it. In this example, we used the following approach:
1. Before saving layout settings, serialize all documents created from the ViewModel.
2. Before restoring settings, recreate all documents.
↧
How to: Serialize DockLayoutManager When TabbedDocumentUIService Is Used
↧