Ejemplo n.º 1
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;
        }
Ejemplo n.º 2
0
        private static void ArrangeToFill(Size availableSize, Margins margins, ILayoutable layoutable)
        {
            var containerRect = new Rect(new Point(0,0), availableSize);
            var marginsCutout = margins.AsThickness();
            var withoutMargins = containerRect.Deflate(marginsCutout);

            var finalSize = GetConstrainedSize(layoutable, withoutMargins);

            var finalRect = withoutMargins.AlignChild(finalSize, Alignment.Middle, Alignment.Middle);

            layoutable.Arrange(finalRect);
        }