public virtual int Layout(Rectangle extents, int order, LayoutNode parent) { var node = new LayoutNode(parent, this, extents, order); return(DoLayout(extents, order, (child, childExtents, childOrder) => child.Layout(childExtents, childOrder, node))); }
public LayoutNode GetLayout() { var rootNode = new LayoutNode(null, null, UiConstants.UiExtents, 0); DoLayout((extents, order, element) => element.Layout(extents, order, new LayoutNode(rootNode, element, extents, order))); return(rootNode); }
public LayoutNode(LayoutNode parent, IUiElement element, Rectangle extents, int order) { Children = _children.AsReadOnly(); Parent = parent; Element = element; Extents = extents; Order = order; parent?._children.Add(this); }