Well, after yesterday I added a new level of difficulty. We still have the theoretical class Model, ViewModel and View. This time, my model has Threading.Timer (specifically selected to receive timer callbacks in the "wrong" thread.
The model has an ObservableCollection. A timer callback adds items to the collection.
ViewModel simply passes the collection to a view that contains the list associated with the collection.
This does not work.
The model also provides a row that is updated in the same timer callback.
This is also displayed through the viewmodel and attached to the TextBox.
It works.
I saw the hints in my googling that updating collections does not make INotifyCollectionChanged work as expected. I get a full implosion, not even an exception, only the immediate termination of the application.
So there are two questions:
One refers to our discussion yesterday. I use INotifyPropertyChanged and ObservableCollections in my model because this is what the view works for. It still makes sense to me to use these mechanisms to notify my view model or what the base model has ever changed. So, how do I handle updates occurring in another thread?
-, , INotifyPropertyChanged ? string DependencyProperty, Text, DependencyProperty, ? Edit: , , , , , ?
ListBox ItemsSource = "{Binding ObsCollection}". . , , , , Window DataContext, Visual Studio...