예제 #1
0
        protected override Vector2 MeasureOverride(Vector2 availableSize)
        {
            Thickness borderThicknessAndPadding = this.BorderThickness + this.Padding;

            UIElement child = this.Content;

            if (child != null)
            {
                child.Measure(availableSize.Deflate(borderThicknessAndPadding));
                return(child.DesiredSize.Inflate(borderThicknessAndPadding));
            }

            return(borderThicknessAndPadding.Collapse());
        }