Created
November 25, 2018 02:48
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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