I'm trying to make my business objects implement INotifyPropertyChanged using the Set()
method in MVVMLight. This is what I have so far:
public class Person : ObservableObject
{
private readonly Entities.Person entity;
public Person()
{
entity = new Entities.Person();
}
public int ID
{
get { return entity.Id; }
set { Set(() => ID, ref entity.Id, value); }
}
}
Obviously, I can't do this because I get the error:
A property or indexer may not be passed as an out or ref parameter
How should I do this? Do I need to implement INotifyPropertyChanged directly or is there another way to do this?