

Any object can be registered as a recipient for a given message type using a message handler, which will be invoked whenever the IMessenger instance is used to send a message of that type. Types implementing IMessenger are responsible for maintaining links between recipients (receivers of messages) and their registered message types, with relative message handlers. Platform APIs: IMessenger, WeakReferenceMessenger, StrongReferenceMessenger, IRecipient, MessageHandler, ObservableRecipient, RequestMessage, AsyncRequestMessage, CollectionRequestMessage, AsyncCollectionRequestMessage. The MVVM Toolkit provides two implementations out of the box: WeakReferenceMessenger and StrongReferenceMessenger: the former uses weak references internally, offering automatic memory management for recipients, while the latter uses strong references and requires developers to manually unsubscribe their recipients when they're no longer needed (more details about how to unregister message handlers can be found below), but in exchange for that offers better performance and far less memory usage. It is also possible to send messages to specific channels, uniquely identified by a token, and to have different messengers in different sections of an application. This can be useful to decouple different modules of an application without having to keep strong references to types being referenced. The IMessenger interface is a contract for types that can be used to exchange messages between different objects.
