PropertyChanged Event of ViewModel in ObservableCollection
- by developer
Hi All,
I have a observable collection of viewmodel objects. How can I subscribe to the Property Changed event of each view model in my collection as they are created and track which ones have been changed, so that I can updated them to my database.
//This is how I load my data
public static ObservableCollection<ProgramViewModel> program { get; set; }
program = new ObservableCollection<ProgramViewModel>();
foreach (DomainObject obj in res.ResultSet)
{
Program prg = (Program)obj;
program.Add(new ProgramViewModel(prg));
}