Пример #1
0
        /// <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);
        }
Пример #2
0
        /// <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);
        }
Пример #3
0
        /// <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);
        }
Пример #4
0
 Pixel IUnit.ToPixels(float dp)
 {
     return(Pixel.Val(ToPixles(dp)));
 }
Пример #5
0
 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);
 }
Пример #6
0
 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);
 }
Пример #7
0
 public Pixel ToPixels(float unit)
 {
     return(Pixel.Val(unit));
 }