/// <summary> /// Place this box above provided reference box. Reference is in view coordinate system. /// </summary> public static T Above <T>(this T box, RectangleF reference, Pixel dx) where T : ILayoutBox { var referenceOffset = box.Bounds.Bottom - reference.Top; box.SetBottom(Pixel.Val(referenceOffset + dx.Value)); return(box); }
/// <summary> /// Place this box below provided reference box. Reference is in view coordinate system. /// </summary> public static T Below <T>(this T box, RectangleF reference, Pixel dx) where T : ILayoutBox { var referenceOffset = reference.Bottom - box.Bounds.Top; box.SetTop(Pixel.Val(referenceOffset + dx.Value)); return(box); }
/// <summary> /// Place this box after provided reference box. Reference is in view coordinate system. /// </summary> public static T After <T>(this T box, RectangleF reference, Pixel dx) where T : ILayoutBox { var referenceOffset = reference.Right - box.Bounds.Left; box.SetLeft(Pixel.Val(referenceOffset + dx.Value)); return(box); }
Pixel IUnit.ToPixels(float dp) { return(Pixel.Val(ToPixles(dp))); }
public static T CenterVertically <T>(this T box, Pixel dx) where T : ILayoutBox { box.SetCenterY(Pixel.Val(box.Bounds.Top + box.Bounds.Height / 2 + dx.Value)); return(box); }
public static T CenterHorizontally <T>(this T box, Pixel dx) where T : ILayoutBox { box.SetCenterX(Pixel.Val(box.Bounds.Left + box.Bounds.Width / 2 + dx.Value)); return(box); }
public Pixel ToPixels(float unit) { return(Pixel.Val(unit)); }