protected override Size MeasureOverride(Size constraint)
{
if (Child != null) {
constraint = SizeToRatio(constraint, false);
Child.Measure(constraint);
if (double.IsInfinity(constraint.Width)
|| double.IsInfinity(constraint.Height)) {
return SizeToRatio(Child.DesiredSize, true);
}
return constraint;
}
// we don't have a child, so we don't need any space
return new Size(0, 0);
}