Skip to content

Instantly share code, notes, and snippets.

@einarwh
Created April 28, 2012 21:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save einarwh/2522103 to your computer and use it in GitHub Desktop.
Save einarwh/2522103 to your computer and use it in GitHub Desktop.
Dependent properties
private DateTime _birthDate;
public DateTime BirthDate
{
get { return _birthDate; }
set { _birthDate = value; }
}
[Viewable]
public int Age
{
get { return DateTime.Now.Years - BirthDate.Years; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment