In WPF we have two threads (at least): rendering and a UI thread. When I raise an event OnNotifyPropertyChanged on some property changes, it is raised on the UI thread. This information needs to be dispatched to WPF rendering thread for re-rendering. I am assuming it is done in a synchronous manner ( Dispatcher.Invoke ) but how does it really work?
If I raise multiple OnNotifyPropertyChanged events for the same data structure without locking access to the accessor property for this data structure for which these events have been raised, am I creating a potential race condition? I have seen the infamous "Collection was modified; enumeration operation may not execute" exception coming from WPF, so it looks like WPF processes these events asynchronously. Am I misunderstanding the exception? Thanks!