Here is a quick section of code for both the send and the register. Your Notification is the message that instructs the receiver what the intention was. The Content is the item you wanted to send, and you can further identify who sent the message, and even what object this message was intended for with the sender and the target.
Messenger.Default.Send<NotificationMessage<Job>>(
new NotificationMessage<Job>(this, myJob, "Add"));
Messenger.Default.Register<NotificationMessage<Job>>(
this, nm =>
{
// this might be a good idea if you have multiple recipients.
if (nm.Target != null &&
nm.Target != this)
return;
// This is also an option
if (nm.Sender != null &&
nm.Sender != expectedFrom) // expectedFrom is the object whose code called Send
return;
// Processing the Message
switch(nm.Notification)
{
case "Add":
Job receivedJob = nm.Content;
// Do something with receivedJob
break;
case "Delete":
Job receivedJob = nm.Content;
// Do something with receivedJob
break;
}
});
If this helps, please mark as answered.