Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 4
0
 Pixel IUnit.ToPixels(float dp)
 {
     return(Pixel.Val(ToPixles(dp)));
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 7
0
 public Pixel ToPixels(float unit)
 {
     return(Pixel.Val(unit));
 }