Answer the question
In order to leave comments, you need to log in
With frequent updates of the application window control, the window slows down. How to get rid of?
I have a single window WPF application that has a DataGrid. The application window class has a method that updates the contents of the DataGrid. Updates occur frequently, up to several times per second. Since the application window and its controls work in the same thread, there are brakes. The window is bad, responsive, poorly dragged across the desktop, and so on ... Why this happens is understandable. It's not clear how to get rid of it. What can be done about it?
Thank you.
Answer the question
In order to leave comments, you need to log in
I did something like this:
BindingList (or ObservalCollection) stores a collection of what needs to be shown in the DataGrid. It is bound once when the form is launched to the ItemsSource.
The update procedure receives the updated list and compares it with the one displayed in the DataGrid. There are three options - deleted, added, updated. All three parts are neatly and simply described. It is your collection that is changing. Change events are automatically fired for it, and changes are immediately displayed in the DataGrid, since it can work correctly with both BindingList and ObservalCollection.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question