protected override Size ArrangeOverride(Size finalSize)
{
double maxWidth = 0;
double maxHeight = 0;
foreach (var child in Children)
{
child.Arrange(new Rect(maxWidth, 0, child.DesiredSize.Width, finalSize.Height));
maxWidth += child.DesiredSize.Width;
maxHeight = Math.Max(maxHeight, child.DesiredSize.Height);
}
return new Size(maxWidth, maxHeight);
}