Пример #1
0
            public override Rect GetDockedRect(Size childSize, Margin margin, Alignments alignments)
            {
                var marginsCutout = margin.AsThickness();
                var availableRect = OriginalRect.Deflate(marginsCutout);
                var alignedRect   = AlignToLeft(availableRect, childSize, alignments.Vertical);

                AccumulatedOffset += childSize.Width;
                margin.Horizontal  = margin.Horizontal.Offset(childSize.Width, 0);

                return(alignedRect);
            }
Пример #2
0
            public override Rect GetDockedRect(Size childSize, Margin margin, Alignments alignments)
            {
                var marginsCutout  = margin.AsThickness();
                var withoutMargins = OriginalRect.Deflate(marginsCutout);
                var finalRect      = withoutMargins.AlignChild(childSize, Alignment.End, alignments.Vertical);

                AccumulatedOffset += childSize.Width;
                margin.Horizontal  = margin.Horizontal.Offset(0, childSize.Width);

                return(finalRect);
            }
Пример #3
0
        public Rect GetDockingRect(Size sizeToDock, Margins margins, Alignments alignments)
        {
            var marginsCutout = margins.AsThickness();
            var withoutMargins = OriginalRect.Deflate(marginsCutout);
            var finalRect = withoutMargins.AlignChild(sizeToDock, Alignment.End, alignments.Vertical);

            AccumulatedOffset += sizeToDock.Width;
            margins.HorizontalMargin = margins.HorizontalMargin.Offset(0, sizeToDock.Width);

            return finalRect;
        }
Пример #4
0
 public static Alignments Swap(this Alignments alignments)
 {
     return(new Alignments(alignments.Vertical, alignments.Horizontal));
 }
Пример #5
0
 public abstract Rect GetDockedRect(Size childSize, Margin margin, Alignments alignments);