Simple ViewModel graphs
class Person
{
public String FirstName { get; set; }
public String LastName { get; set; }
}class PersonViewModel : MementoEntity
{
public void Initialize( Person person, Boolean registerAsTransient )
{
if( registerAsTransient )
{
this.RegisterTransient();
}
this.SetInitialPropertyValue( () => this.FirstName, person.FirstName );
this.SetInitialPropertyValue( () => this.LastName, person.LastName );
}
public String FirstName
{
get { return this.GetPropertyValue( () => this.FirstName ); }
set { this.SetPropertyValue( () => this.FirstName, value ); }
}
public String LastName
{
get { return this.GetPropertyValue( () => this.LastName ); }
set { this.SetPropertyValue( () => this.LastName, value ); }
}
}Last updated