Skip to content

Instantly share code, notes, and snippets.

@jcbozonier
Created February 16, 2009 22:35
Show Gist options
  • Select an option

  • Save jcbozonier/65425 to your computer and use it in GitHub Desktop.

Select an option

Save jcbozonier/65425 to your computer and use it in GitHub Desktop.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using FantasyNewApp.Utilities;
namespace FantasyNewApp.Models
{
public class Person : INotifyPropertyChanged
{
private string _FirstName;
private string _MiddleName;
private string _LastName;
public string FirstName
{
get
{
return _FirstName;
}
set
{
if(_FirstName == value) return;
_FirstName = value;
PropertyChanged.Notify(() => FirstName);
PropertyChanged.Notify(() => DisplayName);
}
}
public string MiddleName
{
get
{
return _MiddleName;
}
set
{
if (_MiddleName == value) return;
_MiddleName = value;
PropertyChanged.Notify(() => MiddleName);
PropertyChanged.Notify(()=>DisplayName);
}
}
public string LastName
{
get
{
return _LastName;
}
set
{
if (_LastName == value) return;
_LastName = value;
PropertyChanged.Notify(() => LastName);
PropertyChanged.Notify(() => DisplayName);
}
}
public string DisplayName
{
get
{
return string.Format("{0} {1} {2}", FirstName, MiddleName, LastName);
}
}
public event PropertyChangedEventHandler PropertyChanged;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment