I have a StackPanel with several TextBlocks in it, like this:
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock Text="First is quite lengthy" />
<TextBlock Text="This one's shorter"/>
<TextBlock Text="This one too"/>
<TextBlock Text="This one is a bit longer again"/>
</StackPanel>
I want to justify all of them, so that both the left sides and the right sides of the TextBlocks are aligned vertically - how can I do that?
Here's what the above code looks like:
Rough estimation of what I want to achieve:
I have tried experimenting with TextAlignment (Justify does not work for me), FontStretch, HorizontalAlignment, DockPanel and Viewbox (which does not work since I want to keep the font size constant). Is there anything I can do to achieve this without hard-coding some spaces inside of the texts?


