tags:

views:

34

answers:

2

I have two ViewModels WindowViewModel & StatusBarViewModel. i want to updatethe property StatusBarVM in WindowViewModel when there is a change in StatusBarViewModel instance

Following is the property in WindowViewModel

public StatusBarViewModel StatusBarVM
+1  A: 

The MVVM Light Toolkit provides a Messenger class that is designed for exactly this purpose. Here's a sample on how to use it for VM to VM communication: http://chriskoenig.net/2010/07/05/mvvm-light-messaging/.

Chris Koenig
how can i achieve this using DelegateCommand
suman
To do that would require that one VM know about the other in order to call methods on it. Not sure that's the best way to do it. AS I understand it, Commands are more designed to enable the View talk back to the ViewModel, not for one VM to talk to another VM...
Chris Koenig
A: 

use the eventaggregator from prism. You dont have to use the whole prism library...just that part. I have used this very successfully in an enterprise app that I am working on...

ecathell
Could you please share any sample application of prism using eventaggregator
suman