Hi, I want to filter my observable collection of viewmodel objects to the objects that are updated. I have subscribed to the Property Changed event for each viewmodel. But I am not sure how shall I track the objects so the end result would be only the objects that are updated in the UI.
ProgramViewModel Cur=new ProgramViewModel(prg);
Cur.PropertyChanged += new PropertyChangedEventHandler(Cur_PropertyChanged);
program.Add(Cur);
//here program is my observable collection of viewmodels
void Cur_PropertyChanged(object sender, PropertyChangedEventArgs e)
{
//What will be the code that will filter out only updated objects
throw new NotImplementedException();
}
//Now in my Save Event handler
private void Save_Click(object sender, RoutedEventArgs e)
{
foreach (ProgramViewModel model in program)
{
//I need only updated objects here to be added to database
}
}