views:

26

answers:

1

Hi.

I'm creating my first application using MVVM. I'd like to have a usercontrol that shows the results of some functions. Something like VS Error List. I.E. if I choose some xml file in some other usercontrol and try to deserialize it, I'd like to have on this notification list some info like "Deserialization complete" or "Deserialization error". There is more than one control that should send such notifications.

As I said it's my first MVVM project and I'd like to know what kind of solution should I choose to accomplish this task.

A: 

The best way to do that is to use Messaging for this. I prefer to use MVVM light and if you use that you can create your own type of Message and broadcast that message from several locations in your application and Register to that message in the Usercontrol to show these messages.

Example of Messaging with MVVM Light can be found here: http://blog.galasoft.ch/archive/2009/09/27/mvvm-light-toolkit-messenger-v2-beta.aspx

Wouter Janssens - Xelos bvba
I followed the idea of messaging and it works nice till the moment I have to send message from child object to the parent, which is an element of the list. Some code is here http://stackoverflow.com/questions/3574821/wpf-mvvm-how-to-send-message-only-to-parent Should I still use messaging or some other construction should be used here?
Bartek