Bind a TextBox to a large string in WPF using MVVM

I have a performance issue linking a large string to a TextBox in WPF.

In the view, I bind the TextBox Text property to the output property view, which is StringBuilder.

View:

<TextBox Text="{Binding Output, Mode=OneWay}" IsReadOnly="True"/>

ViewModel:

    public StringBuilder Output
    {
        get { return _output; }
    }

As the text in StringBuilder increases, the performance of the binding decreases.

What is the best way to do this using MVVM?

+3
source share
2 answers

One way to circumvent delays in data binding is to use asynchronous binding. You can do this by setting the IsAsync property of your binding object:

, , , , , .

, ( ), . msdn β†’ http://msdn.microsoft.com/en-us/library/ms753174.aspx.

+4

, , , StringBuilder. , , - , StringBuilder. , , StringBuilder .

, , .

0

Source: https://habr.com/ru/post/1715433/


All Articles