Xamarin.form Page Navigation in mvvm

前端 未结 8 1065
耶瑟儿~
耶瑟儿~ 2021-02-04 03:52

I am working on xamarin.form cross-platform application , i want to navigate from one page to another on button click. As i cannot do Navigation.PushAsync(new Page2());

8条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-04 04:23

    A simple way is

    this.ContinueBtnClicked = new Command(async()=>{
    
        await Application.Current.MainPage.Navigation.PushAsync(new Page2());
    });
    

提交回复
热议问题