How to notify all properties of the view model has changed

mkus picture mkus · Aug 6, 2010 · Viewed 8.5k times · Source

In MVVM pattern, how to notify all properties of the view model has changed? I don' t want to call all notifypropertychanged event of all properties.

I have an entity class and in view model I wrote all of the public fields of the entity as public properties. I want to rebind new entity and just write a single line of code to notify that all properties has changed?

Thanks for your help.

Answer

Thomas Levesque picture Thomas Levesque · Aug 6, 2010

Just raise the PropertyChanged event with an empty string as the property name :

OnPropertyChanged(String.Empty);