Helloall
Helloall

Reputation: 3

Xamarin.Forms - How to click Back button on Button click

I am new to Xamarin.Forms. Now my question is

So I need to click Back button on "Submit" Button click. So can some one help me to achieve this.

Regards,

Upvotes: 0

Views: 687

Answers (2)

Debasish
Debasish

Reputation: 457

You can achieve it by doing the following:

Navigate from Main Page to Sub Page

Navigation.PushAsync(new SubPage());

Navigate back to Main Page from Sub Page

Navigation.PopAsync();

More info. can be found here

Upvotes: 0

Jason
Jason

Reputation: 89214

display the Sub page as a modal

Navigation.PushModalAsync(new SubPage());

and then in SubPage, in your button click handler

Navigation.PopModalAsync();

Upvotes: 4

Related Questions