Message to StatusbarView

Topics: Bootstrappers & IoC, Getting Started
Oct 30, 2011 at 9:00 AM

Hi,

I want to handle the messaging to the StatusbarView solutionwide. But not the ViewModel should send the message, the message itself should send.
Example:

using( var msg = new StatusBarMessage("Loading ..."))
{
   // Code for work
}

On Creation the Messageobject send itself to the StatusbarView and on disposing it sends itself with a clearmessage.
That should work in any ViewModel and also in Backgroundjobs and the Viewmodel and the Backgroundjob must not know about the statusbar.
I don't know, if that works with the eventaggregator and when, then how?

Regards,

Wolfgang

Nov 2, 2011 at 12:51 AM

eventaggregator would be the best option.  It would be something would be on the shellviewmodel (if it exists) and messages would be published to it.

Nov 2, 2011 at 7:56 AM

Hmmm.

The StatusBarViewModel implemets the IHandle<StatusBarMessage> and the method 'Handle' handle it. That's clear.

But how must the StatusBarMessage be declared dot send itself?