Tuesday, September 03, 2013

Use Fody to Simplify INotifyPropertyChanged Implementation

I was looking for a way to simplify implementing INotifyPropertyChanged. The standard way was too noisy to my taste so it would be really nice if there is a way to simplify it. Early on the search I stumble upon PostSharp . However, it's quite expensive and seems to be a relatively big "framework" for just my simple needs.

I later found the PropertyChanged.Fody and it fits my needs nicely. It is free and works really well. You just need to install with the command below in NuGet's Package Manager Console

PM> Install-Package PropertyChanged.Fody

and you are good to go. NuGet will take care of installing the needed dependencies e.g: Fody.  Implementing INotifyPropertyChanged is now just a matter of adding  [ImplementPropertyChanged] attribute to a class. Very convenient.

No comments: