Return to Snippet

Revision: 12890
at March 31, 2009 14:28 by bokkers


Initial Code
public class ViewModelBase : INotifyPropertyChanged
{
      #region INotifyPropertyChanged Members

      public event PropertyChangedEventHandler PropertyChanged;

      public void NotifyChanged(string propertyName)   
      {   
            if (string.IsNullOrEmpty(propertyName))   
                throw new ArgumentNullException("propertyName");   
  
            if (PropertyChanged != null)   
                PropertyChanged(this, new PropertyChangedEventArgspropertyName));   
       } 

      #endregion
}

Initial URL


Initial Description
This class can be used as a base class for ViewModel-classes used in a MVVM design pattern.

Initial Title
ViewModelBase class

Initial Tags


Initial Language
C#