How do you handle the deletion of your model working with ViewModels and keeping them in sync ?

Posted by Lisa on Stack Overflow See other posts from Stack Overflow or by Lisa
Published on 2010-12-23T18:40:45Z Indexed on 2010/12/23 19:54 UTC
Read the original article Hit count: 452

Filed under:
|
|
|
|

Hello,

these could be my entity relations:

1 Pupil has 1 Chair

1 Pupil has N Documents

1 Pupil has N Marks

1 Pupil has N IncidentReports

etc...

So with that sample I get 4 IEnumerable from my database put each into an ObservableCollection.

Now I have 4 different Views each bound to one of those 4 collections.

Lets assume I delete a single PupilViewModel in the AdministrationController which is the only View where I can delete a PupilViewModel.

Now I have to inform 3 other Controller and their ObservableCollections about the one deleted PupilViewModel to keep the whole application synchronized... thats stupid somehow.

Do you have any good advice on that scenario?

AND it gets even worse. If I delete a schoolclass I have to sync the pupils everywhere AND the documents or incidentreports or marks...

gush... o_O

© Stack Overflow or respective owner

Related posts about wpf

Related posts about sqlite