#844 – The TextBlock Supports Hyphenation
June 18, 2013 Leave a comment
If a TextBlock is set to wrap text automatically, you can also tell it to automatically hyphenate by setting its IsHyphenationEnabled property to true.
In the example below, the first two blocks of text are left justified, but the second block has hyphenation enabled.
The third block enables hyphenation for a justified block of text.
<TextBlock Text="{StaticResource someText}" TextWrapping="Wrap" TextAlignment="Left" Margin="10"/> <TextBlock Text="{StaticResource someText}" TextWrapping="Wrap" IsHyphenationEnabled="True" TextAlignment="Left" Margin="10"/> <TextBlock Text="{StaticResource someText}" TextWrapping="Wrap" TextAlignment="Justify" IsHyphenationEnabled="True" Margin="10"/>