Inform Viewmodel to Save

Topics: Issues / bugs, Questions
Mar 25, 2015 at 2:59 PM
Hi

In my mainviewmodel I have a command. On the execute of this command a other viemodel should be informed to save itself.

To do this I added a InterestedIn Attribut in my "otherviewmodel" to mainviewmodel and override the OnViewModelCommandExecuted

The problem. If I call the SaveViewModel in the method OnViewModelCommandExecuted I get an exception in class ManagedViewModel in method NotifyViewModelsOfEvent.
foreach (IViewModel model in from viewModelKeyValuePair in this._interestedViewModels select viewModelKeyValuePair.Value)
InvalidOperationException -> the enumeration is changed