ObservableObject.RaisePropertyChanged should call VerifyAccess()

Aug 19, 2009 at 8:14 AM

The "RaisePropertyChanged" method of the ObservableObject class does not check, whether the PropertyChangedEvent is fired on the CurrentDispatcher.
In my opinion these events should always be fired on the main thread, as it is very likely that some UIElement has a binding to it which would in that case cause an exception.

--> !VerifyAccess() --> Application.Current.Dispatcher.BeginInvoke(...)

What do you think about that?

Coordinator
Aug 19, 2009 at 6:15 PM

There's no need to marshal the call over to the UI thread.  Property bindings in WPF automatically marshal property change notifications to the UI thread, if necessary.