Today I want to share with you a very nice way for customizing text wrapping on TextBlock in WPF.
Sometimes happens that displayed string are too long to be displayed entirely in a single cell and you need to split the string in multiple lines. WPF is able to automatically split long string in multiple lines via TextWrapping property. However it can happens that the line breaking algorithm used by WPF does not satisfy your requirements, especially when you need to split your application specific strings like mathematical formulas or hierarchy paths.

Lets assumes we would like to display a string in a multi line way like the following pictures:

In order to achieve these results we need to set the TextBlock in the following way: