Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programmatically go back

In my application, the user goes from Page A to Page B.

Is there any way to programmatically simulate the back button press? I have a button on Page B and when the user clicks it, I want to go BACK to page A. I don't want to use the NavigationService and navigate to page A, I want to go back to Page A as if the user clicked on the hardware back button. Is there any way to do that?

like image 988
user1924391 Avatar asked Nov 29 '22 16:11

user1924391


1 Answers

Although you say you don't want to use it, the NavigationService.GoBack method is the way to go:

if (this.NavigationService.CanGoBack)
{
    this.NavigationService.GoBack();
}
like image 69
Michaël Hompus Avatar answered Dec 09 '22 09:12

Michaël Hompus