I am using your Docking Sample code that came with the download.
I have added a couple of menu items to save and restore layout:
private void OnSaveLayout(object sender, RoutedEventArgs e) {
string layout = new DockSiteLayoutSerializer().SaveToString(dockSite);
File.WriteAllText("C:\\Temp\\Layout.txt", layout);
}
private void OnRestoreLayout(object sender, RoutedEventArgs e) {
string layout = File.ReadAllText("C:\\Temp\\Layout.txt");
new DockSiteLayoutSerializer().LoadFromString(layout, dockSite);
}
I also modified the section that creates new documents as follows:
// Create the document
var documentWindow = new EditorDocumentWindow(data, text) {
SerializationId = serializationId.ToString()
};
++serializationId;
dockSite.DocumentWindows.Add(documentWindow);
// Activate the document
documentWindow.Activate();
}
private int serializationId = 1;
Using the UI I have moved the Solution Explorer to the top and split the document area into two sections having two documents in it each. I then use the Save Layout and close the application. Then I restart the modified sample and click the Restore Layout. The Solution Explorer is moved to the top, but the document section is a single section with a single document. If I manually add the documents back then and use Restore Layout again, the documents remain in the same section instead of being split into two document areas.
My ultimate goal is to restore the document area with all document windows that were there when the layout was saved. I would appreciate any assistance that you could offer in this area. As I am using the sample application you can suggest changes to that.
Best Regards
Mark Mazurik