Great performance when using TextWrapping and ScrollViewer

I have the following XAML snippet:

<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled"> <TextBlock HorizontalAlignment="Stretch" Margin="10" VerticalAlignment="Stretch" TextWrapping="Wrap"/> </ScrollViewer> 

When I resize the window where the ScrollViewer is located, I have a very big performance problem: the window freezes for a few seconds!

How can I solve this problem?

+4
source share
1 answer

if it is possible and makes sense, try changing the target structure to 4 or higher (on the project properties page). it helps sometime. CLR 4 is much faster.

0
source

All Articles