Is it possible to use TextBox in "virtual" mode.
I want to supply text on demand, when user scrolls through the document.
Is it possible to use TextBox in "virtual" mode.
I want to supply text on demand, when user scrolls through the document.
I thought virtual mode was intended to speed up application performance by only getting and rendering data on demand. If the user is scrolling through the document, doesn't that imply that the data is already loaded? Couldn't you databind the TextBox to a property in code-behind and merely set the value of that property while the user is scrolling?
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?