MVVM: What if the model is constantly changing in the background thread?

This is a big problem for me. I want to write a WPF / MVVM application that retrieves data from an online WCF service.

The problem is that the sampling process should be, say, 15 seconds (this is a time critical application).

This uses a constantly changing IEnumerable, every time I check the WCF service, I get different values, because there is also time data.

How would I do that? Clearing an ObservableCollection in a ViewModel may not be right or is it?

+3
source share
2 answers

ObservableCollection :

. : ItemsControl.ItemsSource MVVM

, , , . .

+5

, , (, ), .

, ObservableCollection , INotifyPropertyChanged.

, .

, , / ( ViewModel, , , ), Dispatcher.Invoke.

+1

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


All Articles