Hello,
I have identified the cause of the issue with different sizes.
Before
<controls:MainDockSite
x:Name="DockSite"
DocumentItemContainerStyle="{StaticResource SlotGroupWindowStyle}"
DocumentItemTemplate="{StaticResource SlotGroupTemplate}"
DocumentItemsSource="{Binding Items}"
Layout="{Binding Layout}"
Style="{StaticResource DockSiteStyle}">
<docking:Workspace>
<docking:TabbedMdiHost ContainersHaveNewTabButtons="True" TabOverflowBehavior="ScrollWithMenu" />
</docking:Workspace>
</controls:MainDockSite>
After
<controls:MainDockSite
x:Name="DockSite"
DocumentItemContainerStyle="{StaticResource SlotGroupWindowStyle}"
DocumentItemTemplate="{StaticResource SlotGroupTemplate}"
DocumentItemsSource="{Binding Items}"
Layout="{Binding Layout}"
Style="{StaticResource DockSiteStyle}">
<docking:SplitContainer>
<docking:Workspace>
<docking:TabbedMdiHost ContainersHaveNewTabButtons="True" TabOverflowBehavior="ScrollWithMenu">
<docking:TabbedMdiContainer />
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:SplitContainer>
</controls:MainDockSite>
We have modified the Outer DockSite hierarchy to follow the order shown in the Actipro example.
And here is the serialization result of the Inner DockSite.
Before
<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="SplitContainer" Orientation="Horizontal" DockedSize="1462,894.666666666667">
<UIElement xsi:type="ToolWindowContainer" DockedSize="0,894.666666666667" SelectedWindowUniqueId="8ecb4b90-0caf-4a40-be99-01ec40823521">
<UIElement xsi:type="ToolWindowRef" UniqueId="8ecb4b90-0caf-4a40-be99-01ec40823521" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" DockedSize="0,200" SelectedWindowUniqueId="b5b8bf55-cf35-4a2b-980d-1bf319b6b1dd">
<UIElement xsi:type="ToolWindowRef" UniqueId="b5b8bf55-cf35-4a2b-980d-1bf319b6b1dd" />
</UIElement>
</Content>
<ToolWindows>
<ToolWindow UniqueId="8ecb4b90-0caf-4a40-be99-01ec40823521" SerializationId="21" ContainerDockedSize="0,894.666666666667" IsOpen="true" LastActiveDateTime="2024-10-18T16:45:23.4502985+09:00" State="Docked" Type="VM.Windows.Post.Controls.SlotWindow, Postprocessor" />
<ToolWindow UniqueId="b5b8bf55-cf35-4a2b-980d-1bf319b6b1dd" SerializationId="22" ContainerDockedSize="0,200" IsOpen="true" LastActiveDateTime="2024-10-18T16:45:16.6083189+09:00" State="Docked" Type="VM.Windows.Post.Controls.SlotWindow, Postprocessor" />
</ToolWindows>
</DockSiteLayout>
After
<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="SplitContainer" Orientation="Horizontal" DockedSize="1462,894.666666666667">
<UIElement xsi:type="ToolWindowContainer" DockedSize="1268,894.666666666667" SelectedWindowUniqueId="9af0e507-9417-4619-a344-bb831c9c6a46">
<UIElement xsi:type="ToolWindowRef" UniqueId="9af0e507-9417-4619-a344-bb831c9c6a46" />
</UIElement>
<UIElement xsi:type="ToolWindowContainer" DockedSize="188,200" SelectedWindowUniqueId="6042efb6-2569-42fd-b268-273d01a292fb">
<UIElement xsi:type="ToolWindowRef" UniqueId="6042efb6-2569-42fd-b268-273d01a292fb" />
</UIElement>
</Content>
<ToolWindows>
<ToolWindow UniqueId="9af0e507-9417-4619-a344-bb831c9c6a46" SerializationId="5" ContainerDockedSize="1268,894.666666666667" IsOpen="true" LastActiveDateTime="2024-10-19T11:44:01.1113922+09:00" State="Docked" Type="VM.Windows.Post.Controls.SlotWindow, Postprocessor" />
<ToolWindow UniqueId="6042efb6-2569-42fd-b268-273d01a292fb" SerializationId="6" ContainerDockedSize="188,200" IsOpen="true" LastActiveDateTime="2024-10-19T11:43:52.4503008+09:00" State="Docked" Type="VM.Windows.Post.Controls.SlotWindow, Postprocessor" />
</ToolWindows>
</DockSiteLayout>
The difference is that, when looking at the Size values in the "Before" state, all the width values are 0. This suggests that the issue might be due to the DockSite hierarchy, which is preventing proper size calculation.
For reference, the XAML of the Inner DockSite has not been changed and is as follows:
<controls:SlotGroupDockSite
x:Name="DockSite"
Layout="{Binding Layout}"
Style="{StaticResource DockSiteStyle}"
ToolItemContainerStyle="{StaticResource SlotWindowStyle}"
ToolItemTemplateSelector="{StaticResource SlotViewModelTemplateSelector}"
ToolItemsSource="{Binding Items}">
<docking:SplitContainer>
<docking:ToolWindowContainer />
</docking:SplitContainer>
</controls:SlotGroupDockSite>