I have a TextBlock, wrapped in a ScrollViewer, and the Text property of the TextBlock is set with the result of a Task. The scrollbars of the TextBlock do not adjust to the size of the text returned by the task.
Any ideas?
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="500"/>
</Grid.ColumnDefinitions>
<ScrollViewer VerticalScrollBarVisibility="Auto"
Height="177"
Width="500"
HorizontalScrollBarVisibility="Disabled">
<TextBlock Height="177"
Text="Extracted Xml"
Width="504"
HorizontalAlignment="Stretch"
TextWrapping="Wrap" />
</ScrollViewer>
</Grid>
ScrollViewer calculates it's scrollbars based on dimensions of child controls.
Thus, remove Height property from your TextBlock and ScrollBars should work as expected
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With