S
S
sergeyfk2017-11-22 16:17:44
WPF
sergeyfk, 2017-11-22 16:17:44

How to improve TextBox performance and scroll down on refresh?

In general, I decided to rewrite the old project under WPF with MVVM and ran into such a problem
... enough text.
I would like to make sure that the entire text is not redrawn, but only a new one is added. Well, after the update, scroll down. At the same time, it is imperative to preserve the MVVM approach.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sumor, 2017-11-22
@Sumor

Event TextChanged -> (sender as TextBox).ScrollToEnd();
The text will still be replaced.
Only the visible part is drawn. But, if there is a ScrollBar, the control needs to know the height of the entire text, and when the text is inserted, the height of the entire text is recalculated. Especially if TextWrapping is installed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question