using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.ComponentModel;

namespace Silverlight_Binding_TreeView
{
	public class Employee : INotifyPropertyChanged
	{
		private string name;
		private bool selected;
		private bool expanded;
		private bool check;

		public Employee(string name, bool selected, bool expanded, bool check)
		{
			this.name = name;
			this.selected = selected;
			this.expanded = expanded;
			this.check = check;
		}

		public string Name
		{
			get
			{
				return this.name;
			}
			set
			{
				if (this.name != value)
				{
					this.name = value;
					this.NotifyPropertyChanged("Name");
				}
			}
		}
		public bool Selected
		{
			get
			{
				return this.selected;
			}
			set
			{
				if (this.selected != value)
				{
					this.selected = value;
					this.NotifyPropertyChanged("Selected");
				}
			}
		}
		public bool Expanded
		{
			get
			{
				return this.expanded;
			}
			set
			{
				if (this.expanded != value)
				{
					this.expanded = value;
					this.NotifyPropertyChanged("Expanded");
				}
			}
		}
		public bool Checked
		{
			get
			{
				return this.check;
			}
			set
			{
				if (this.check != value)
				{
					this.check = value;
					this.NotifyPropertyChanged("Checked");
				}
			}
		}

		#region INotifyPropertyChanged Members

		public event PropertyChangedEventHandler PropertyChanged;
		private void NotifyPropertyChanged(string propertyName)
		{
			if (PropertyChanged != null)
			{
				PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
			}
		}

		#endregion
	}
}
