WPF Text Box in Virtual Mode

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

I want to provide text on demand when a user scrolls a document.

+6
wpf textbox lazy-loading
source share
2 answers

To use the built-in virtualization (i.e. VirtualizingStackPanel, the default ListBox), you must be able to place content in items that can be loaded sequentially as needed (logical scrolling). For this, arbitrary large text will require a lot of preprocessing to calculate line breaks and break text into lines or groups of lines. After that, you will need to use the container obtained from ItemsControl, instead of one TextBox. Do you have a requirement to have editable text?

+1
source share

I thought that virtual mode was designed to speed up applications by only receiving and providing data on demand. If a user scrolls a document, doesn't that mean the data is already loaded? Could you bind the TextBox to a property in the code and just set the value of this property while the user scrolls?

0
source share

All Articles