I have a ToolWindow (named "autoHideLeft") within another ToolWindow. I want to force the autoHideLeft control (inner ToolWindow) to always dock on the left side of its parent window. The current behavior is that the inner ToolWindow will dock on the left as long as the parent ToolWindow is docked itself. When the parent ToolWindow is undocked and floating the inner ToolWindow will dock to the right when its pin is released. Hopefully this makes sense.
XAML snippet:
<docking:DockSite
x:Name="dockSite"
Grid.Row="1"
DockPanel.Dock="Left"
ToolWindowsHaveOptions="False"
CanToolWindowsDockRight="False"
>
<docking:DockSite.AutoHideLeftContainers>
<docking:ToolWindowContainer x:Name="docToolContainer" docking:DockSite.ControlSize="230, 575">
<docking:ToolWindow x:Name="autoHideLeft" Title="Layers" CanClose="False"
CanAutoHide="True" CanRaft="True" CanDockRight="False">
<ContentPresenter
Content="{Binding Path=LayerManagerViewModel, Mode=OneWay}">
</ContentPresenter>
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:DockSite.AutoHideLeftContainers>
Another aspect of this issue seems to be related to how we persist and restore the docked state of the inner tool window.
We determine and save the state upon application exit with the following:
bool isLayerManagerDocked = (LayoutMap2View.Instance.autoHideLeft.State == ActiproSoftware.Windows.Controls.Docking.DockingWindowState.Docked);
Then we restore this state when the application starts back up with the following:
if (isLayerManagerDocked)
{
autoHideLeft.Dock(dockSite, ActiproSoftware.Windows.Controls.Docking.Direction.Left);
}
This seems to work well in restoring the state to either pinned open or not, but the side effect of this is the behavior explained above (docking to right side issue). The issue goes away when we don't restore state using this code. I don't understand the relationship here and why this would cause the autoHideLeft ToolWindow to dock to the right when it's parent window is not docked itself.
Any thoughts, ideas, or advice would be appreciated.
XAML snippet:
<docking:DockSite
x:Name="dockSite"
Grid.Row="1"
DockPanel.Dock="Left"
ToolWindowsHaveOptions="False"
CanToolWindowsDockRight="False"
>
<docking:DockSite.AutoHideLeftContainers>
<docking:ToolWindowContainer x:Name="docToolContainer" docking:DockSite.ControlSize="230, 575">
<docking:ToolWindow x:Name="autoHideLeft" Title="Layers" CanClose="False"
CanAutoHide="True" CanRaft="True" CanDockRight="False">
<ContentPresenter
Content="{Binding Path=LayerManagerViewModel, Mode=OneWay}">
</ContentPresenter>
</docking:ToolWindow>
</docking:ToolWindowContainer>
</docking:DockSite.AutoHideLeftContainers>
Another aspect of this issue seems to be related to how we persist and restore the docked state of the inner tool window.
We determine and save the state upon application exit with the following:
bool isLayerManagerDocked = (LayoutMap2View.Instance.autoHideLeft.State == ActiproSoftware.Windows.Controls.Docking.DockingWindowState.Docked);
Then we restore this state when the application starts back up with the following:
if (isLayerManagerDocked)
{
autoHideLeft.Dock(dockSite, ActiproSoftware.Windows.Controls.Docking.Direction.Left);
}
This seems to work well in restoring the state to either pinned open or not, but the side effect of this is the behavior explained above (docking to right side issue). The issue goes away when we don't restore state using this code. I don't understand the relationship here and why this would cause the autoHideLeft ToolWindow to dock to the right when it's parent window is not docked itself.
Any thoughts, ideas, or advice would be appreciated.