When deserializing a lazy-loaded layout that had been saved with open documents, but where there are currently no open document windows, an empty TabbedMdiContainer is shown, which is not visually appealing / a good UX.
This behaviour can be quickly mocked-up in the serialization sample by setting the xaml to look like:
...
<docking:Workspace>
<docking:TabbedMdiHost/>
</docking:Workspace>
...
- Then adding code to programmatically add a DocumentWindow to the docksite from one of the ToolWindow commands.
- Set the DockSite to Serialize DocumentWindows, and use either the discard or lazy-load modes.
- Save the layout and switch between samples.
Is there a proper way to prevent this behaviour?
My current workaround is that in the TabbedMdiContainer Style, I added a Trigger to change the Visibility to Hidden when the SelectedWindow is null (I believe only possible when no documents are open).
Thanks