I use these two snippets a lot for WPF and Silverlight development. I decided to post them on the blog so that I have them available to me whenever and wherever. I always seem to be searching through older projects for this code.
vmb
This snippet creates the ViewModelBase that I use almost everywhere. It simply implements INotifyPropertyChanged and works in both WPF and Silverlight. I use this for my ViewModels so that the properties on the VM are observable for databinding. I use this in conjunction with my propsn snippet that creates a property with SafeNotify calls in the setter.
mb
This snippet is used to create the ModelBase. Again, this is a WPF / Silverlight compatible class. I link my model such that it compiles for WPF and Silverlight so that I can share my model between my WCF and my UI. This class gives me INotifyPropertyChanged, SafeNotify, and a ToString implementation that uses reflection to dump a shallow representation of the class.
Hope this code helps someone.
682c9d01-be01-481b-92ef-28c1094139d8|0|.0