private int GetMaxWidth() { if (maxWidth.HasValue) { return(maxWidth.Value); } if (Parent == null) { return(RenderWidth - Margin.HorizontalSum()); } return(Parent.MaxWidth - Margin.HorizontalSum()); }