So, what is the difference between MessagingCenter and Events?

Technology CommunityCategory: XamarinSo, what is the difference between MessagingCenter and Events?
VietMX Staff asked 3 years ago

Events makes a strong coupling between objects, means Sender and Receiver have to know about each other. Due to this coupling, sometimes, resources doesn’t get freed up from memory, and we have to unsubscribe events to free up the resources properly.

MessagingCenter decouples objects and thus there is no such dependency among objects and so they get freed up when no longer required. But using too much of MessagingCenter can make it harder for developers to understand who sent it and when they sent it, making it hard to debug the code too. So, we should use them wisely.