I want to be able to save the Document Layout (Example: Side-by-Side Windows) and then restore the layout.
I have no issue with restoring the data. My windows get displayed, but by default they are tabbed.
Here is my code to save my Document Windows
var dockSiteSerializer = new DockSiteLayoutSerializer();
dockSiteSerializer.SerializationBehavior = DockSiteSerializationBehavior.All;
return dockSiteSerializer.SaveToString(documents);
I get the following xml:
<DockSiteLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SerializationFormat="All">
<AutoHideHost />
<Content xsi:type="Workspace" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="SplitContainer" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900" Orientation="Horizontal">
<UIElement xsi:type="TabbedMdiContainer" AutoHideSize="495,900" DockedSize="495,900" DocumentSize="495,900" FloatingSize="495,900" Size="495,900" SelectedWindowUniqueId="07a3dea9-9184-42eb-b58a-d2e4c08af0d4">
<UIElement xsi:type="DocumentWindowRef" UniqueId="07a3dea9-9184-42eb-b58a-d2e4c08af0d4" />
</UIElement>
<UIElement xsi:type="TabbedMdiContainer" AutoHideSize="495,900" DockedSize="495,900" DocumentSize="495,900" FloatingSize="495,900" Size="495,900" SelectedWindowUniqueId="23e0e2db-f3f5-40df-aa4f-1352a12e625b">
<UIElement xsi:type="DocumentWindowRef" UniqueId="23e0e2db-f3f5-40df-aa4f-1352a12e625b" />
</UIElement>
</Content>
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="07a3dea9-9184-42eb-b58a-d2e4c08af0d4" AutoHideSize="495,900" DockedSize="495,900" DocumentSize="495,900" FloatingSize="495,900" Size="495,900" IsOpen="true" LastState="Document" Name="X07a3dea9" State="Document" />
<DocumentWindow UniqueId="23e0e2db-f3f5-40df-aa4f-1352a12e625b" AutoHideSize="495,900" DockedSize="495,900" DocumentSize="495,900" FloatingSize="495,900" Size="495,900" IsOpen="true" LastState="Document" Name="X23e0e2db" State="Document" />
</DocumentWindows>
</DockSiteLayout>
When data gets refreshed and I want to restore the layout I get a blank page when I restore the layout. Here is the xml before I do a LoadFromString(layout, documents):
<DockSiteLayout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SerializationFormat="All">
<AutoHideHost />
<Content xsi:type="Workspace" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="TabbedMdiContainer" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900" SelectedWindowUniqueId="eb4ba382-2911-4851-995c-09cb3da314b0">
<UIElement xsi:type="DocumentWindowRef" UniqueId="eb4ba382-2911-4851-995c-09cb3da314b0" />
<UIElement xsi:type="DocumentWindowRef" UniqueId="cdb6dfa6-57cd-4e73-8041-697fd1612e0c" />
</Content>
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="eb4ba382-2911-4851-995c-09cb3da314b0" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900" IsOpen="true" LastState="Document" Name="Xeb4ba382" State="Document" />
<DocumentWindow UniqueId="cdb6dfa6-57cd-4e73-8041-697fd1612e0c" AutoHideSize="995,900" DockedSize="995,900" DocumentSize="995,900" FloatingSize="995,900" Size="995,900" IsOpen="true" LastState="Document" Name="Xcdb6dfa6" State="Document" />
</DocumentWindows>
</DockSiteLayout>
I noticed that the UniqueID's are different. Please help me with this issue. Thanks!