Forcing a Textblock in WPF to use all available vertical space and wrap its content

196 Views Asked by At

I have a simple Grid with an Image on the left side and a TextBlock on the right, each contained by a ViewBox to handle scaling. The ViewBox.Height containing the TextBlock is bound to Image.ActualHeight. Here is what I get:

What I have

But what I actually want to achieve is that TextBlock.FontSize is automatically adjusted, so that all available vertical space is used and its content wraps. So it should rather look about like that:

What I want

How can I achieve that?

0

There are 0 best solutions below