Reputation: 718
I have a TextBlock, as follows:
<TextBlock Text="|e|" Padding="2" HorizontalAlignment="Center" TextWrapping="Wrap" Background="AliceBlue" />
However, this renders as a single vertical line, like so:
I can do any of the following and it renders as expected:
(The background setter is not relevant and is included merely to show that the TextBlock appears to be allocating space for the text.)
Can anyone shed any light on this seemingly bizarre behaviour?
Upvotes: 0
Views: 156
Reputation: 46
You can use: HorizontalAlignment="Stretch" TextAlignment="Center"
<TextBlock Text="|e|" Padding="2" TextWrapping="Wrap" Background="AliceBlue" HorizontalAlignment="Stretch" TextAlignment="Center" />
Upvotes: 1