/// <summary> /// Adds a child widget. /// </summary> /// <param name='widget'> /// The widget /// </param> /// <param name='bounds'> /// Position and size of the child widget, in container coordinates /// </param> /// <remarks> /// The widget is placed in the canvas area, in the specified coordinates and /// using the specified size /// </remarks> public void AddChild(Widget widget, Rectangle bounds) { if (positions == null) { positions = new Dictionary <Widget, Rectangle> (); } positions [widget] = bounds; var bk = (IWidgetBackend)Widget.GetBackend(widget); Backend.AddChild(bk, bounds); RegisterChild(widget); }
public void AddChild(Widget w, Rectangle rect) { if (positions != null) { positions = new Dictionary <Widget, Rectangle> (); } var bk = (IWidgetBackend)Widget.GetBackend(w); Backend.AddChild(bk); Backend.SetChildBounds(bk, rect); RegisterChild(w); OnPreferredSizeChanged(); }
public void AddChild(object nativeChild) { Backend.AddChild(nativeChild); }