Beispiel #1
0
        protected virtual void LayoutChildren(double x, double y, double width, double height)
        {
            var       area         = new Rectangle((int)x, (int)y, (int)width, (int)height);
            Rectangle originalArea = area;

            if (_containerAreaSet)
            {
                area         = ContainerArea;
                area.X      += (int)Padding.Left;
                area.Y      += (int)Padding.Right;
                area.Width  -= (int)Padding.HorizontalThickness;
                area.Height -= (int)Padding.VerticalThickness;
                area.Width   = Math.Max(0, area.Width);
                area.Height  = Math.Max(0, area.Height);
            }

            List <Element> elements = LogicalChildren.ToList();

            foreach (Element element in elements)
            {
                var page = element as Page;
                // if (page != null && page.IgnoresContainerArea)
                // Forms.Layout.LayoutChildIntoBoundingRegion(child, originalArea);
                // else
                // Forms.Layout.LayoutChildIntoBoundingRegion(child, area);
            }
        }
Beispiel #2
0
        protected virtual void LayoutChildren(double x, double y, double width, double height)
        {
            var       area         = new Rectangle(x, y, width, height);
            Rectangle originalArea = area;

            if (_containerAreaSet)
            {
                area         = ContainerArea;
                area.X      += Padding.Left;
                area.Y      += Padding.Right;
                area.Width  -= Padding.HorizontalThickness;
                area.Height -= Padding.VerticalThickness;
                area.Width   = Math.Max(0, area.Width);
                area.Height  = Math.Max(0, area.Height);
            }

            List <Element> elements = LogicalChildren.ToList();

            foreach (Element element in elements)
            {
                var child = element as VisualElement;
                if (child == null)
                {
                    continue;
                }
                var page = child as Page;
                if (page != null && page.IgnoresContainerArea)
                {
                    Maui.Controls.Layout.LayoutChildIntoBoundingRegion(child, originalArea);
                }
                else
                {
                    Maui.Controls.Layout.LayoutChildIntoBoundingRegion(child, area);
                }
            }
        }