First docked window does not get the requested dock size

Docking/MDI for WPF Forum

The latest build of this product (v25.1.1) was released 3 months ago, which was before this thread was created.
Posted 1 month ago by Bas van der Laken
Version: 25.1.1
Platform: .NET 9
Environment: Windows 11 (64-bit)
Avatar

In our WPF application we have a main-view containing a docking host and an initial tool window that takes up the space of the entire window and we use for main view content.

When opening an additional tool window with the ContainderDockSize set and DockSide set to Bottom, the very first time the height of the newly docked window is just a random number. Any subsequent opening of such a tool window, with the exact same ContainerDockSize and DockSide Bottom, ends up being created with exactly the requested height in the ContainerDockSize.

I had found this issue in 24.1.3 and after upgrading to 25.1 the issue still exists.

Comments (3)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I tried adding a second tool window docked Bottom in a DockSite.Loaded event handler, and it showed up correctly.  Make sure that you do it as or after DockSite.Loaded fires, since otherwise the DockSite likely won't have been arranged properly and sizes may not be set yet, throwing off docking results.

If that doesn't help, please send our support address a new simple sample project showing the issue so we can debug with it.  Be sure to exclude the bin/obj folders from the .zip you send so it doesn't get spam blocked.  Thanks!


Actipro Software Support

Posted 1 month ago by Bas van der Laken
Avatar

I have noticed the issue when the docking is done prior to loading the WPF control and had already resolved that. The problem still occurs when the window is added seconds or minutes later.

It is always the very first window that is docked with the existing window. I have the problem in a real application, which adds the tool window after the load event and in a small test application. In the latter the window is opened after user interaction, so the problem is really not tied to the dock site not being ready.

I'll see if I can create a simplified version of the test application that I can send.

Answer - Posted 1 month ago by Bas van der Laken
Avatar

Resolved: the problem was the layout of the initial view. It contained a SplitContainer eventhough there was nothing to split.

<actiproDocking:DockSite x:Name="DockingSite"
                         ClosePerContainer="True"
                         SnapsToDevicePixels="True"
                         MagnetismSnapDistance="10"
                         ToolWindowsHaveTitleBarIcons="True">
    <actiproDocking:SplitContainer x:Name="DockingSplitContainer">
        <actiproDocking:ToolWindowContainer BorderThickness="0">
            <actiproDocking:ToolWindow x:Name="FillerViewWindow"
                                       HasTitleBar="False"
                                       CanDragTab="False"
                                       CanAttach="False"
                                       CanAutoHide="False"/>
        </actiproDocking:ToolWindowContainer>
    </actiproDocking:SplitContainer>
</actiproDocking:DockSite>

Although the behavior should not occur, my problem is gone after I had removed the DockingSplitContainer from the above code.

Add Comment

Please log in to a validated account to post comments.