How to pass a parameter from one Page to another Page in Xamarin.Forms?

前端 未结 3 464
小蘑菇
小蘑菇 2021-02-06 11:44

I want to send a value when I press a button in a form to another form through the MVVM pattern.

This is the XAML file

 
3条回答
  •  醉酒成梦
    2021-02-06 12:06

    Good example of passing parameters to ViewModel and getting result back: How do I pass entry parameters to Xamarin MVVM viewmodel

    To navigate from ViewModel to next page (View):

    await Xamarin.Forms.Application.Current.MainPage.Navigation.PushAsync(new MyView());

提交回复
热议问题