Currently, I'm showing a really long text inside a RichTextBlock
inside a ScrollViewer
.
The problem is since ScrollViewer
doesn't support virtualization, loading the page takes a few seconds, and changing font size (it's an option for the user) takes a long time and may even cause the app to crash.
One solution came to my mind is to break RichTextBlock
to a number of RichTextBlock
s inside a ListView
(which supports Virtualization).
But this approach has a little problem. Let's say I show each 500 lines of text inside a RichTextBlock
. Now, the user may want to select and copy some text; while it'll work well in most cases, but he'll never be able to select lines 498 to 503, because they are in two separate RichTextBlock
s.
Is there any way to fix the text selection issue in this approach? Or can you suggest a better way for implementing virtualization?