Monday, February 1, 2010

Type safe INotifyPropertyChanged

Usually we pass the property name as string from the setter of properties and raise the INotifyPropertyChanged.PropertyChanged event.This is not type safe as you.There are chances that the end developers may misspell the property name.The below link gives a great idea to make your OnPropertyChanged calls type safe.

http://mfelicio.wordpress.com/2010/01/10/safe-usage-of-inotifypropertychanged-in-mvvm-scenarios/

1 comment:

  1. I tried this for some scenarios but not for RaisePropertyChanged.I used this mainly in PropertyChanged Event.This can be used anywhere we want to check propertyname.I forgot to post it in my blog.Thank you for reminding me:-)What you have highlighted is a good scenario.Thanks.

    ReplyDelete