/// <summary> /// Caclulated layout center in view coordinates in pixels. /// </summary> public static PointF Center(this ILayoutBox box) { var frame = box.Frame(); return(new PointF(frame.Left + frame.Width / 2, frame.Top + frame.Height / 2)); }
/// <summary> /// Place this box above provided reference layout box. Reference is in view coordinate system. /// </summary> public static T Above <T>(this T box, ILayoutBox reference, float dx = 0) where T : ILayoutBox { return(box.Above(reference.Frame(), dx)); }
/// <summary> /// Build <see cref="IViewLayoutBox"/>. /// </summary> /// <param name="v">View geometry (usually cross platform View wrapper)</param> /// <param name="outerBounds">Optional outer bounds to override this builder <see cref="OuterBounds"/>.</param> public IViewLayoutBox View(PlatformView v, ILayoutBox outerBounds) { return(View(v, outerBounds.Frame())); }
/// <summary> /// Place this box below provided reference layout box. Reference is in view coordinate system. /// </summary> public static T Below <T>(this T box, ILayoutBox reference, float dx = 0) where T : ILayoutBox { return(box.Below(reference.Frame(), dx)); }
/// <summary> /// Builds box with specified outerBounds, padding and units. /// </summary> /// <returns>The box.</returns> /// <param name="outerBounds">Outer bounds.</param> public ILayoutBox Box(ILayoutBox outerBounds) { return(Box(outerBounds.Frame())); }