using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace WPF.HandleValueChange
{
	public class Person:INotifyPropertyChanged
	{
		#region INotifyPropertyChanged Members
		public event PropertyChangedEventHandler PropertyChanged;

		#endregion

		private int age;

		public int Age
		{
			get
			{
				return age;
			}
			set
			{
				age = value;
				this.OnPropertyChanged("Age");
			}
		}

		private string name;

		public string Name
		{
			get
			{
				return name;
			}
			set
			{
				name = value;
				this.OnPropertyChanged("Name");
			}
		}

		protected virtual void OnPropertyChanged(string propertyName)
		{
			if (this.PropertyChanged != null)
			{
				this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}
	}
}
