IMessenger interface

Apr 3, 2010 at 2:28 PM

Hi Josh,

is there a reason why you didn't expose the Messenger through an interface? I just stumbled upon this as I was writing a unit test to verify that one of my classes registered correctly with the Messenger. I then added this interface to the MVVM Foundation solution to make it easier to replace it with a mock object:

using System;

namespace MvvmFoundation.Wpf
{
	public interface IMessenger
	{
		void NotifyColleagues(string message, object parameter);
		void NotifyColleagues(string message);
		void Register(string message, Action callback);
		void Register<T>(string message, Action<T> callback);
	}
}

Coordinator
Apr 3, 2010 at 2:31 PM

No, there's no reason why.  I just never saw the need for it, I guess.  You raise a good point.  I'll add it to my TODO list.

Thanks,

Josh

Apr 3, 2010 at 2:38 PM

Great, thanks for the info.

-- Matthias