LineStackingStategy on TextBlock in Windows apps

LineStackingStrategy is a property on the TextBlock controls.
If used right you can control the LineHeight and make text lines get closer or further away from to each other. This can be useful to increase readability for text, creating multiline header etc.

The TextBlock have three options for the LineStackingStrategy property: MaxHeight, BlockLineHeight and BaselineToBaseline.

MaxHeight is the default property value on a TextBlock. What MaxHeight does is that it looks at the tallest element in the line and that item determine the stack height of the specific line.

BlockLineHeight sets the height is determined the LineHeight property value. Each line will have the minimum nessecary lineheight per default dertimined by the fontsize.

BaselineToBaseline stacks the height determined by adding LineHeight to the baseline of the previous line. 
Important: Even though you change the LineStackStrategy from default, you have to set the LineHeight to actually apply it.

Visual example of the LineStackingStrategy applied

There is used a 18pt LineHeight to demo this. You see the big difference when you have different fontsizes inside a text. The column on the left is how it looks with default settings:

If you have problems working with lineheight just reach out to me. I'd be more than happy to help you.
Thanks for reading.

P.S Make sure you follow me on twitter @deanihansen for more news, design tips, articles and how-to's.