I am writing a WPF application using Prism and I am new to Prism
I am facing the following concern :
I will create modules that will be coupled with events, in my case a module will get an image from a camera and send it to a module that will treat the image. For now I am emulating by passing a string like in the event aggregator sample 14 from Prism.
I create the two modules like this
moduleCatalog.AddModule<ModuleProcess.ModuleProcessModule>("ModuleProcess-1");
moduleCatalog.AddModule<ModuleProcess.ModuleProcessModule>("ModuleProcess-2");
Now if I instantiate 2 camera module and 2 process module I want to be able to filter like this so that the process 1 only listen to events from camera 1 (with Ids for example)
So in the constructor of my ViewModel
_ea.GetEvent<MessageSentImageEvent>().Subscribe(MessageImageReceived, x => x._iDest == iId);
My Message paylod is like this
public class MessageImagePayload
{
public int _iDest;
//...
}
What I don't understand is how set the iId value in the view model when the modules are created (is it possible to find back the original module name ("ModuleProcess-1") from the view model or the solution is something else ?