Xamarin.Forms Messaging center failing silently

I had a problem with Xamarin.Forms MessagingCenter – as sometimes the messages disappeared. Code that on most occasions worked nicely failed silently and from debug output – the messages never reached the subscription methods. What I eventually found out was happening (after days of frustration) was that one of the subscriptions was updating the UI and since this is on a thread other than the main one – it just failed silently and the next message subscription never got the message. This is not a 100% diagnostic (I don’t care to waste more time on this) but moving the UI updates explicitly to the main thread solved the issue. Hope this helps someone … a day or two of pointless debugging 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s