public void Behave(LayoutedElement element) { if (element.ForcedInnerHeight.IsDefined) return; element.ForcedInnerHeight = Unit.Max(CalculateHeight(element), element.Children.OuterHeight); }
protected override Unit CalculateHeight(LayoutedElement element) { return specification.Font.CalculateTextHeight(specification.TextContent, element.ForcedInnerWidth); }
protected abstract Unit CalculateHeight(LayoutedElement element);
protected override Unit CalculateHeight(LayoutedElement element) { return specification.Source.Height*(element.ForcedInnerWidth/specification.Source.Width); }