Strange behavior when ContainerMinSize is set for several (tool/document)windows

Docking/MDI for WPF Forum

Posted 26 days ago by Dirk Zellerfeld
Version: 20.1.1
Platform: .NET 5.0
Environment: Windows 10 (64-bit)

Lets say I have an application window which has a size of 1727x921. Then I have 4 ToolWindows which are next to each other horizontically. Now two of these 4 toolwindows have a fixed width. The first one of 1000 and the other of 300. If I start the application, it works as expected.

However now the user will resize the application window to make it smaller, from 1727 width to 1711. What happens is that all 4 toolwindows will have the same width, minimum size is ignored. Although 1000 + 300 < 1711. There should be enough width left.

I've modified the ContainerSizeRestriction example and created a GIF demonstrating the issue:

The problem besides the visual glitch is also that, if these 4 toolwindows all have the same width, you can no longer use the resize bar between them to change the width via dragging the mouse cursor. They react like all have a fixed size:

Comments (3)

Posted 24 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Dirk,

What's happening is that once all 4 tool windows reach their minimum width, it goes into fallback layout logic where it distributes the widths evenly and doesn't allow resizing.  I can reproduce the same thing here and it does that switch once all 4 get to their specified minimum width.  This logic is by design.

Normally you wouldn't set nearly such a wide minimum width.  Instead you could set a thinner minimum width, and use ContainerDockedSize instead of ContainerMinSize to set the large initial width.  You could put a ScrollViewer as a child of the tool window to help with scenarios when the size of that intended wider tool window is reduced.  Then this fallback layout logic will only occur when the window width is at a smaller size, which is more the intention of its usage.

Actipro Software Support

Posted 22 days ago by Dirk Zellerfeld

The container shows a website which is not responsive, so its becomes bugged when the width is too small. Therefore we cannot lower the minimum width and a scrollviewer isn't possible.

Is it somehow possible to have a document/tool window not going smaller than a specific width in ALL possible cases?

Posted 22 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Dirk,

The ToolWindow width is limited by the width of the ToolWindowContainer, which in turn is limited by its container (such as a SplitContainer/DockSite), all the way up to the containing Window.  Unfortunately there isn't a way to prevent a ToolWindow from going smaller than a certain size once the ContainerMinSize thresholds are reached since at that point something has to give.

Actipro Software Support

The latest build of this product (v21.1.0) was released 7 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.