Dear Techie,
How to use the messaging center to return the list of model to Nextpage.cs
Thanks in advance,
Vasanth
Based on your Nextpage.cs in previous link, please make following test. I pop up window in BtnRegistration_Clicked ,
public partial class Nextpage : ContentPage { List<Model> SelectedModels=new List<Model>(); public Nextpage() { InitializeComponent(); MessagingCenter.Subscribe<App, List<Model>>(App.Current, "OneMessage", (snd, arg) => { Model model = arg.FirstOrDefault<Model>(); txtName.Text = model.profile_name; txtEmail.Text = model.user_id; }); } protected override void OnAppearing() { base.OnAppearing(); } private async void BtnRegistration_Clicked(object sender, EventArgs e) { await Navigation.PushPopupAsync(new Tagfriends()); } private void BtnUpdate_Clicked(object sender, EventArgs e) { } private void txtAddress_Focused(object sender, FocusEventArgs e) { } } }
then popup the Taggingfriend page, click the button click event, back to the Nextpage, please copy my code completely to make a test.
private async void Button_Clicked(object sender, EventArgs e) { List<Model> result = Models.Where(w => w.IsChecked == true).ToList(); MessagingCenter.Send<App, List<Model>>((App)App.Current, "OneMessage", result); await Navigation.PopPopupAsync(); }
Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.
Answers
Based on your Nextpage.cs in previous link, please make following test. I pop up window in BtnRegistration_Clicked ,
then popup the Taggingfriend page, click the button click event, back to the Nextpage, please copy my code completely to make a test.
Xamarin forums are migrating to a new home on Microsoft Q&A!
We invite you to post new questions in the Xamarin forums’ new home on Microsoft Q&A!
For more information, please refer to this sticky post.