Reputation: 1138
I'm using AvalonDock(Extended.Wpf.Toolkit, free version) in an app for my employer. Setting DockWidth
or DockHeight
in either LayoutAnchorablePane
or LayoutDocumentPane
has no(visible) effect. Instead, each pane occupies an equivalent amount of space relative to its siblings(they default to 1*).
They can be resized at runtime with the built-in splitters, but that doesn't help programmatically or at design time. I've used some workarounds such as:
DockMinWidth
/DockMaxWidth
to the
same value, but obviously the splitters stop moving.Both of which are dirty hacks that I'd like to avoid.
I'm aware that this was done in the past with ResizingPanel
, but it's been long since removed. See this for related information.
I've yet to find the answer in the documentation or the source code.
See my answer.
Here's a simplified example demonstrating the problem.
Upvotes: 2
Views: 760
Reputation: 1138
This post pointed me in the right direction.
The issue is indeed internal code. The following fixed it:
ILayoutPositionableElement.cs
. I named it ForceFixedDockSize
.LayoutPositionableGroup.cs
.OnFixChildrenDockLengths
, check if the flag is true before setting DockWidth
or DockHeight
.I suspect the reason this behavior exists is to make default layouts look consistent. This change makes that behavior optional.
See my fork.
Upvotes: 1