PropertyChanged Event of 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/28 20:37 UTC
Read the original article Hit count: 200

Filed under:
|

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.

List<DomainObject> objectsToSave = new List<DomainObject>();            
            foreach (Test val in dirtyObjs)
            {
                objectsToSave.AddRange(val.GetObjectsToSave());
            }

            //DB changes
            bool saveSucceeded = DataServices.SaveMultiple(objectsToSave);

© Stack Overflow or respective owner

Related posts about wpf

Related posts about observablecollection