Skip to content

Instantly share code, notes, and snippets.

@juucustodio
Created November 25, 2018 02:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save juucustodio/e238ec75a2dfb215c4f5490ed3ddd5ad to your computer and use it in GitHub Desktop.
Save juucustodio/e238ec75a2dfb215c4f5490ed3ddd5ad to your computer and use it in GitHub Desktop.
Example of how to use MessagingCenter in Xamarin.Forms applications. - https://julianocustodio.com/messagingcenter
using Xamarin.Forms;
namespace DemoMessagingCenter
{
public partial class MainPage : TabbedPage
{
int cont = 0;
public MainPage()
{
InitializeComponent();
MessagingCenter.Subscribe<Message>(this, "AddItem", message => {
cont++;
ContItem.Text = cont.ToString();
});
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment