I am using a TextBlock in WPF, on which I want to use TextWrapping, What I have done in XAML is as follows.
<TextBlock TextWrapping="Wrap" Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="0" Margin="5,5,5,5">
<TextBlock.Text>
This is just a test. This is just a test.
</TextBlock.Text>
</TextBlock>
When I run this code it shows output like this
This is just a test. Th
is is just a test.
But I only want wrapping on white spaces like
This is just a test.
This is just a test.
I am unable to find why WPF is showing this behavior, I have tried WrapWithOverflow
and IsHyphenationEnabled=true
with no success. Please help me out?