.Net property changed notification

A demo of how to setup property change notification:

using System;
using System.Collections.Generic;
using System.ComponentModel;

namespace PropertyChangeNotifier
{
    class ChangeHandler
    {
        static void Main()
        {
            var thisClass = new PropertyNotifier
                            {
                                Property1 = 11,
                                Property2 = "String value",
                                Property3 = 44.00
                            };

            Console.WriteLine(thisClass.Property1);
            Console.WriteLine(thisClass.Property2);
            Console.WriteLine("{0:0.00}", thisClass.Property3);

            Console.ReadKey();
        }
    }

    public class PropertyNotifier : INotifyPropertyChanged
    {
        public event PropertyChangedEventHandler PropertyChanged;

        private int _property1;
        private string _property2;
        private double _property3;

        public int Property1
        {
            get { return _property1; }
            set { SetPropertyField("Property1", ref _property1, value + 1); }
        }
        public string Property2
        {
            get { return _property2; }
            set { SetPropertyField("Property2", ref _property2, value + " - Changed!"); }
        }
        public double Property3
        {
            get { return _property3; }
            set { SetPropertyField("Property3", ref _property3, value + 1.0); }
        }

        protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            var handler = PropertyChanged;

            if (handler != null)
            {
                handler(this, e);
            }
        }

        private void SetPropertyField<T>(string propertyName, ref T field, T newValue)
        {
            if (EqualityComparer<T>.Default.Equals(field, newValue)) return;

            field = newValue;

            OnPropertyChanged(new PropertyChangedEventArgs(propertyName));
        }
    }
}

Returns:


12
String value - Changed!
45.00