Wednesday, 11 September 2013

In WPF, a ViewModel have a reference to a Model

In WPF, a ViewModel have a reference to a Model

Assume that there're a PIModel (i.e. Personal Information Modle) and a
ViewModle(contains some infomation from PIModel and other).
// PIModel
public PIModel
{
private string firstName;
public string FirstName { get; set; }
private string lastName;
public string LastName { get; set; }
... // other
}
Then, the FirstName property and the LastName property need to be bound to
View, so I have two Question:
Whether the ViewModel have a property reference to a PIModel instance;
If so, whether the ViewModel have two propertise reference to
PIModel.FirstName and PIModel.LastName.
I learn about that implement the INotifyPropertyChanged in Model is not
recommended.

No comments:

Post a Comment