PropertyChanged Event of ViewModel in ObservableCollection
Posted
by developer
on Stack Overflow
See other posts from Stack Overflow
or by developer
Published on 2010-04-28T19:56:50Z
Indexed on
2010/04/29
19:17 UTC
Read the original article
Hit count: 344
wpf
|observablecollection
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));
}
© Stack Overflow or respective owner