Hey,
I'm trying to serialize a DockSite with TabbedMdiHost that hosts several DockSites with StandardMdiHost and DocumentWindows (basically, tabs that contain windows with separated Views), the serialization looks like this:
<DockSiteLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SerializationFormat="All" Version="2">
<AutoHideHost />
<Content xsi:type="Workspace">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="TabbedMdiContainer" DockedSize="772,363" SelectedWindowUniqueId="b477fd4f-74b3-4074-a8cc-675ec8fe2692">
<UIElement xsi:type="DocumentWindowRef" UniqueId="499fb5f3-008f-4b79-a4ee-fdfa26de4b36" />
<UIElement xsi:type="DocumentWindowRef" UniqueId="b477fd4f-74b3-4074-a8cc-675ec8fe2692" />
</Content>
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="499fb5f3-008f-4b79-a4ee-fdfa26de4b36" SerializationId="Page1" ContainerDockedSize="772,363" IsOpen="true" LastActiveDateTime="2021-05-16T15:55:20.7123613+03:00" State="Document" />
<DocumentWindow UniqueId="b477fd4f-74b3-4074-a8cc-675ec8fe2692" SerializationId="Page2" ContainerDockedSize="772,363" IsOpen="true" LastActiveDateTime="2021-05-16T15:55:22.8691845+03:00" State="Document" />
</DocumentWindows>
</DockSiteLayout>
But, each DocumentWindow contains DockSite with StandardMdiHost and more DocumentWindow and its information is discarded when serialzing. I tried to save the inner DockSite info in the Tag property, it looks like the information is saved correctly:
<DockSiteLayout xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" SerializationFormat="All" Version="2">
<AutoHideHost />
<Content xsi:type="Workspace">
<Content xsi:type="TabbedMdiHost">
<Content xsi:type="TabbedMdiContainer" DockedSize="772,363" SelectedWindowUniqueId="5758f673-96cd-4d46-9a87-70d9d61c9477">
<UIElement xsi:type="DocumentWindowRef" UniqueId="1ba85ba1-244d-4421-aa26-4778ab58202d" />
<UIElement xsi:type="DocumentWindowRef" UniqueId="5758f673-96cd-4d46-9a87-70d9d61c9477" />
</Content>
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="1ba85ba1-244d-4421-aa26-4778ab58202d" SerializationId="Page1" ContainerDockedSize="772,363" IsOpen="true" LastActiveDateTime="2021-05-17T13:59:18.2278161+03:00" State="Document">
<Tag xsi:type="DockSiteLayout" SerializationFormat="All" Version="2">
<AutoHideHost />
<Content xsi:type="Workspace">
<Content xsi:type="StandardMdiHost" AreWindowsMaximized="false">
<UIElement xsi:type="DocumentWindowRef" UniqueId="519c839b-06b8-4c6e-91d6-0c92304d47fc" />
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="519c839b-06b8-4c6e-91d6-0c92304d47fc" SerializationId="Window1" IsOpen="true" LastActiveDateTime="2021-05-17T13:59:20.5921809+03:00" StandardMdiBounds="1,1,546,90" State="Document" />
</DocumentWindows>
</Tag>
</DocumentWindow>
<DocumentWindow UniqueId="5758f673-96cd-4d46-9a87-70d9d61c9477" SerializationId="Page2" ContainerDockedSize="772,363" IsOpen="true" LastActiveDateTime="2021-05-17T13:59:21.4127636+03:00" State="Document">
<Tag xsi:type="DockSiteLayout" SerializationFormat="All" Version="2">
<AutoHideHost />
<Content xsi:type="Workspace">
<Content xsi:type="StandardMdiHost" AreWindowsMaximized="false">
<UIElement xsi:type="DocumentWindowRef" UniqueId="6b10af78-cd2b-4c9f-810e-5ff37f8f0588" />
<UIElement xsi:type="DocumentWindowRef" UniqueId="f267ef22-37c0-46b2-a754-0eace240e544" />
</Content>
</Content>
<DocumentWindows>
<DocumentWindow UniqueId="6b10af78-cd2b-4c9f-810e-5ff37f8f0588" SerializationId="Window2" IsOpen="true" LastActiveDateTime="2021-05-17T13:59:23.2578814+03:00" StandardMdiBounds="1,1,546,90" State="Document" />
<DocumentWindow UniqueId="f267ef22-37c0-46b2-a754-0eace240e544" SerializationId="Window3" IsOpen="true" LastActiveDateTime="2021-05-17T13:59:23.6519756+03:00" StandardMdiBounds="31,31,546,90" State="Document" />
</DocumentWindows>
</Tag>
</DocumentWindow>
</DocumentWindows>
</DockSiteLayout>
When I try to deserialize, the outer DockSite created correctly (creating its ViewModel and attaching it to DocumentItemsSource), but the inner DockSite is for some reason is null and created when the deserialization process is finished and I'm not able to deserialize the information stored in the Tag property.
Am I doing it totally wrong? Any suggestion?