Is it possible to Trim Wrapped Text at the bottom of the container in WPF?

1.2k Views Asked by At

I would like to trim the contents of a TextBlock at the bottom of the container when it runs out of space. The image below shows what I am trying to achieve.

Example of desired effect

The left cell contains text that is being wrapped at the end of the line, but is being cropped on the final line. The right cell (which I edited by hand) shows the effect I want to achieve by trimming the text on the last line.

Is there an (easy) way to achieve this in WPF?

1

There are 1 best solutions below

2
On BEST ANSWER

Did you try the TextTrimming property?