We discovered some unexpected behavior when adding a new tool window to an existing AutoHide-Group.
Sample Code (new WPF project):
MainWindow.xaml:
<DockPanel>
<Button DockPanel.Dock="Bottom" Content="Add" Click="ButtonBase_OnClick" />
<docking:DockSite x:Name="DockSite" />
</DockPanel>
MainWindow.xaml.cs:
public partial class MainWindow
{
public MainWindow()
{
InitializeComponent();
new ToolWindow(DockSite) {Title = "Tool"}.AutoHide(Dock.Left);
}
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
{
new ToolWindow(DockSite) {Title = "Tool2"}.Dock(DockSite.ToolWindows[0], Direction.Content);
}
}
When running this sample, clicking the Add-button and then the "Auto Hide"-Pin to dock the two tool windows works as we'd expect it.
-> Both tool windows are displayed within the same container.
But the following steps produce an unexpected situation:
- Start the sample
- dock the first tool window (by clicking the "Auto Hide"-Pin)
- hide the window again (clicking "Auto Hide"-Pin again)
- Add the second tool window with the Add-button
- now dock the second tool window (by clicking the "Auto Hide"-Pin)
-> The two tool windows are displayed side-by-side, not within the same container.
Is this a bug or is something important missing?
Thanks in advance
Stefan