Created
February 16, 2009 22:35
-
-
Save jcbozonier/65425 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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