protected override Size MeasureOverride(Size availableSize) { BlockElement child = VisualChild; Size borderThickness = (Stroke.CharThickness + Padding + Thickness.Max(Shadow, 0)).CollapsedThickness; if (child != null) { child.Measure(availableSize - borderThickness); return child.DesiredSize + borderThickness; } return borderThickness; }
protected virtual Size MeasureOverride(Size availableSize) { BlockElement child = VisualChild; if (child == null) { return(new Size(0, 0)); } child.Measure(availableSize); return(child.DesiredSize); }
protected override Size MeasureOverride(Size availableSize) { BlockElement child = VisualChild; Size borderThickness = Padding.CollapsedThickness; if (child != null) { child.Measure(availableSize - borderThickness); return(child.DesiredSize + borderThickness); } return(borderThickness); }