public override Size GetPreferredSize(ViewLayoutContext context)
{
Size preferredSize = Size.Empty;
// Height is the total height of all children, but width is just the widest found
foreach (ViewBase child in this)
{
// Ask child for it's own preferred size
Size childPreferred = child.GetPreferredSize(context);
// Always add on the height of the child
preferredSize.Height += childPreferred.Width;
// Find the widest of the children
preferredSize.Width = Math.Max(preferredSize.Width, childPreferred.Width);
}
return preferredSize;
}