I am writing a C # desktop application using the MVVM template with Entity Framework model. I tend to use DependencyProperties in my virtual machine and have come (usually), preferring this system over the implementation of INotifyPropertyChanged. I would like everything to be in order. My virtual machine accesses objects in the model, and I managed to save something quite separate - the view has no knowledge about VM, except for the name of bindings and commands, and the model knows information about the virtual machine.
Using INotifyPropertyChanged in a virtual machine, it seems pretty easy to update objects in a model:
public string Forename
{
get { return CurrentPerson.Forename; }
set
{
if (Forename != value)
{
CurrentPerson.Forename = value;
NotifyPropertyChanged("Forename");
}
}
}
... CurrentPerson - Person, . , .
DependencyProperties , DP, , GetValue Setvalue, PropertyChangedCallback CurrentPerson Entity. , -, .
, , - ? DependencyProperty INotifyPropertyChanged? , ( ), , "", .