WPF - "LineSpacing" in a text block

I have a TextBlock. I would like to pass the property ' LineSpacing . The thing with LineHeight "with LineStackingStrategy =" BlockLineHeight " is that it also applies LineHeight to the segment before the first line:

TextblockEx http://i61.tinypic.com/2a5y9mw.jpg

How can I save the specified LineSpacing "without changing LineHeight to the first line?

One thing I can use is to split each line in a FlowDocument Paragraph , since the Paragraph has both the Spacing Before Line and Spacing After Line properties.

Any help would be truly appreciated. Thanks in advance.

ANSWER

It seems that you can use LineStackingStrategy = "MaxHeight" to avoid going to the first line. (See below for more details).

PS Thanks to Mitch for the revelation: D

+4
source share
1 answer

It seems that you can use LineStackingStrategy="MaxHeight"to avoid going to the first line:

<TextBlock LineStackingStrategy="MaxHeight" TextWrapping="Wrap" LineHeight="50">Lorem...</TextBlock>

Gives out

Maxheight

+5
source

Source: https://habr.com/ru/post/1542065/


All Articles