Mediator in ViewModelBase better be static.


in ViewModelBase.
    public Mediator Mediator
        get { return mediator; }
better be
    public static Mediator Mediator
        get { return mediator; }
then other class than can use it.
Closed Nov 27, 2011 at 5:14 PM by sachabarber


sachabarber wrote May 2, 2010 at 6:38 AM

Faie enough, I will fix that soon

sachabarber wrote May 4, 2010 at 8:26 AM

That is now done, and there is also a Mediator singleton that you can use anywhere like Mediator.Instance.NotifyCollegues.......

cibrax wrote Sep 9, 2010 at 6:45 PM

One problem I see with this Mediator class is that you can not easily verify in an unit test that the Mediator was called to notifyColleagues, as it can not be mocked. You can still test it, but it requires creating a new class with the attribute MediatorMessageSinkAttribute just to check weather the class I am testing fired a new notification. It would be great to have either way to mock this class or get access to an internal queue with all the fired events.

wrote Jan 1, 2011 at 10:50 AM

wrote Nov 27, 2011 at 5:14 PM

wrote Feb 21, 2013 at 11:07 PM

wrote May 16, 2013 at 10:46 AM