communication from child viewmodels to parent viewmodel

Topics: Prism v1, Prism v2 - WPF 4, Prism v4 - WPF 4
Dec 19, 2011 at 3:00 PM


I have a viewmodel that contains an observablecollection of other viewmodels. When the datacontext of a childviewmodel changes, I would like that the parent viewmodel would be aware of it. For example in the parent viewmodel there should be a property "ChildHasChanged" that can be accessed from the child viewmodel.

What is the correct way to do this ?



Dec 19, 2011 at 5:08 PM


The implementation details of your application depends mostly of your personal preferences and the requirements of your scenario.

Based on my understanding, when implementing the MVVM pattern it's not required for a view model to know its "parent view model." As a possible way to communicate between the "child view model" and the "parent view model" without referencing each other, you might find the approaches described in the following chapter of the Prism documentation useful:

 Also, you can find more information regarding the MVVM pattern and the common approaches of how to implement it in the following links:

I hope you find this useful,

Damian Cherubini