Multiline TextBlock Text

As you have seen, TextBlock supports multiline text, either by setting TextWrapping to Wrap or by using LineBreak instances within the content.

Two properties, LineHeight and LineStackingStrategy, affect how multiline text is displayed. LineHeight determines the height of every line of text in the TextBlock. If LineHeight is set to a smaller value than the FontSize property, it may cause text to be vertically cropped. Typically, you leave LineHeight unset and rely on the default text rendering, which calculates the line height using FontSize plus an internal padding value.

The TextBlock class’s LineStackingStrategy property determines the algorithm that is used to calculate line height. The LineStackingStrategy is an ...

Get Windows® Phone 8 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.