Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF textbox in "virtual" mode

Is it possible to use TextBox in "virtual" mode.

I want to supply text on demand, when user scrolls through the document.

like image 604
Konstantin Spirin Avatar asked Feb 23 '10 03:02

Konstantin Spirin


1 Answers

To use the built in virtualization (i.e. VirtualizingStackPanel used by default ListBox) you need to be able to chunk the content into items which can be progressively loaded one at a time as needed (logical scrolling). To do this for arbitrary large text would involve a lot of pre-processing to calculate line wrapping and break the text up into lines or groups of lines. Once you do that you would need to use a container derived from ItemsControl instead of a single TextBox. Do you have a requirement to have editable text?

like image 119
John Bowen Avatar answered Oct 24 '22 13:10

John Bowen