When I read your question, I assumed that you wanted something like this:
public class UniformWrapPanel : WrapPanel
{
protected override Size MeasureOverride(Size constraint)
{
if(Orientation == Orientation.Horizontal)
ItemWidth = Children.Select(element =>
{
element.Measure(constraint);
return element.DesiredWidth;
}).Max();
else
... same for vertical ...
return base.MeasureOverride(constraint);
}
}
but I see that someone else has already implemented "UniformWrapPanel", and from your comments you indicate that this is not what you were looking for.
A comment I don't understand is:
I want it to not force the elements to be given a size, but use their existing size and therefore automatically determine the width of the columns.
, , , ? . "tabstop", , .