I'm looking to create a MDI interface where DocumentWindows are within a DockSite, and each DocumentWindow hosts its own DockSite. I've been able to mostly piece this together using the NestedDockSites and MvvmDocumentWindows demos.
However, I have a problem where the DocumentWindows' docksites aren't maintaining their state. For example, let's say I have Document 1 and Document 2. In Document 1, I arrange its inner Tool Windows so they're vertically side by side. I then switch to Document 2 and arrange its inner Tool Windows so they're horizontally side by side. When I switch back to Document 1, I expect its inner tool windows to still be arranged vertically but instead, they appear horizontally, matching Document 2's inner layout.
How can I maintain the inner layouts of these documents?
To repro:
1. Replace the DocumentItemStyle in QuickStart\MvvmDocumentWindows\Views\MainView.xml with this:
<Style x:Key="DocumentItemStyle" TargetType="docking:DocumentWindow" BasedOn="{StaticResource DockingItemStyle}">
<Setter Property="FileName" Value="{Binding FileName}" />
<Setter Property="IsReadOnly" Value="{Binding IsReadOnly}" />
<Setter
Property="ContentTemplate"
>
<Setter.Value>
<DataTemplate>
<docking:DockSite x:Name="innerDockSite1" themes:ThemeManager.Theme="CustomGreen">
<docking:ToolWindowContainer>
<docking:ToolWindow Title="Text">
<SyntaxEditor:SyntaxEditor
BorderThickness="0"
>
<Implementation:EditorDocument>
<![CDATA[Sample document.]]>
</Implementation:EditorDocument>
</SyntaxEditor:SyntaxEditor>
</docking:ToolWindow>
<docking:ToolWindow Title="Designer">
<Rectangle
Fill="Red"
/>
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:DockSite>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
2. Run the MvvmDocumentWindows sample and create two documents.
3. In Document 1, arrange the inner tool windows vertically side by side
4. In Document 2, arrange the inner tool windows horizontally side by side.
5. Switch back to Document 1 and notice that the tool window are now arrange horizontally as well.
Note that I tried setting the DockSite's ItemContainerRetentionMode property to Wrapped, but that had no impact.
[Modified 12 years ago]