INotifyPropertyChanged – Class / Event / Property

Class

using System.ComponentModel;

public class MainViewModel : INotifyPropertyChanged
{
   // ...
}

INotifyPropertyChanged – Event

        #region INotifyChangedProperty

        public event PropertyChangedEventHandler PropertyChanged;
        
        // .NET 3.x
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        // .NET 4.x
        //private void NotifyPropertyChanged([CallerMemberName] String propertyName = "")
        //{
        //    PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        //}

        #endregion

Property

        private string _Property;
        public string Property
        {
            get
            {
                return _Property;
            }
            set
            {
                if (value != this._Property)
                {
                    this._Property = value;
                    NotifyPropertyChanged("Property");
                }
            }
        }