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

How do you pass multiple arguments in the MessagingCenter?

$
0
0

We're trying to implement a DisplayAlert bridge between our ViewModel and View by using the MessagingCenter. We wanna pass the title and the message as parameters to the message.

We tried this, which does not work. This is probably an easy one, but it's not explicit (enough for us) in the documentation, there's just an example with 1 string parameter.

MessagingCenter.Subscribe<MainPage, string, string> (this, "DisplayAlert", (sender, title, message) => {
    DisplayAlert(title, message, "Ok");
});

Viewing all articles
Browse latest Browse all 58056

Trending Articles



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