AerialForWindowsTester.AspectRatioLayoutDecorator.MeasureOverride C# (CSharp) Method

MeasureOverride() protected method

protected MeasureOverride ( Size constraint ) : Size
constraint System.Windows.Size
return System.Windows.Size
        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);
        }