Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

How to MessagingCenter.Subscribe to same message from multiple senders

$
0
0

I want to subscribe to a message that can be sent from multiple ViewModels. Is there a more elegant solution than subscribing individually for each ViewModel, like I do below?

MessagingCenter.Subscribe<Page1Model, bool>(this, "SomeMessage", MyMethod);
MessagingCenter.Subscribe<Page2Model, bool>(this, "SomeMessage", MyMethod);

Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>