/// <summary> /// Measures the size for this <see cref="OverlayTextAdorner"/> to render. /// </summary> /// <param name="constraint"> /// The <see cref="Size"/> available to measure. /// </param> /// <returns> /// The <see cref="Size"/> required for this <see cref="OverlayTextAdorner"/>. /// If the internal <see cref="Control"/> has not been initialized, /// zero size will be returned. /// </returns> protected override Size MeasureOverride(Size constraint) { if (overlayTextControl != null) { Size childConstraint = new Size(Double.PositiveInfinity, Double.PositiveInfinity); overlayTextControl.Measure(childConstraint); } return(new Size(0, 0)); }