You can always write your own panel with various docking rules. You can use the standard DockPanel implementation (available in the source code - it doesn't look very complicated) and create something similar with the rules you prefer. You might even be able to create a class that comes from the DockPanel and overrides ArrangeOverride.
But personally, I would just use the dock panel, which does exactly what you want, except that you do not like its rules, according to which a member becomes a fill.
There is a terrible maintenance problem in the IME grid if you insert / delete rows, thereby endlessly setting row numbers - the DockPanel is much easier in this regard.
Update:
Here you go, I denied you the pleasure of doing it yourself - it's just a cut-out / reverse version of the source code:
public class BottomDockingPanel : DockPanel { protected override Size ArrangeOverride(Size arrangeSize) { UIElementCollection children = InternalChildren; int totalChildrenCount = children.Count; double accumulatedBottom = 0; for (int i = totalChildrenCount-1; i >=0 ; --i) { UIElement child = children[i]; if (child == null) { continue; } Size childDesiredSize = child.DesiredSize; Rect rcChild = new Rect( 0, 0, Math.Max(0.0, arrangeSize.Width - (0 + (double)0)), Math.Max(0.0, arrangeSize.Height - (0 + accumulatedBottom))); if (i > 0) { accumulatedBottom += childDesiredSize.Height; rcChild.Y = Math.Max(0.0, arrangeSize.Height - accumulatedBottom); rcChild.Height = childDesiredSize.Height; } child.Arrange(rcChild); } return (arrangeSize); } }
Will dean
source share