Using MessagingCenter
, we can enable our ViewModel
s or other components of our application to communicate with each other, without knowing anything about each other. Thus it decouples senders and receivers from each other. It is just a simple messaging contract, where receiving object has to Subscribe
or Unsubscribe
the Message
sent by the Sender
.
Example: Suppose we want to edit some detail in one Page
, and want to notify the other Pages about this update, then we can send Message
and other Pages, which have subscribed for this Message
, will receive the notification via this Message
and thus we can take appropriate actions in other Pages based on it.