public static void Bind(ILayout layout, Control control) { Func <Rectangle> target = () => new Rectangle(control.ClientRectangle.Left + Padding, control.ClientRectangle.Top + Padding, control.ClientRectangle.Width - 2 * Padding, control.ClientRectangle.Height - 2 * Padding); layout.Apply(control, target()); control.Resize += delegate { layout.Apply(control, target()); }; }
public void ApplyLayout(ILayout layout) { if (layout != null) { layout.Apply(new Rect(new Point(), new Size(ActualWidth, ActualHeight)), RootItem); foreach (var pair in layout.LayoutPositions) { // var item = pair.Key; // var position = pair.Value; // item.AnimationPosition(position); } } }