Xamarin MVVM passing data to other view

后端 未结 3 1024
温柔的废话
温柔的废话 2021-01-27 09:57

I want to pass the data to another view page. So far I can get the data I need to pass. My problem is how do I pass the data in MVVM. I used Application.Current.MainPage.Navigat

3条回答
  •  我在风中等你
    2021-01-27 10:34

    I'm assuming that contactID is an int.

    Create an additional constructor in your DatabaseSyncPage:

    public DatabaseSyncPage (int contactID)
    {
        // TODO: Do something with your id
    }
    

    But this passes the data to the page, not the page model. Are you using any kind of framework? It would probably be worth looking into that.

提交回复
热议问题