Programmatically Go Back to Previous Page in Windows Phone App

The developers can use the NavigationService.GoBack method to navigate to the previous page of the Windows Phone App. When using the NavigationService.GoBack , it is necessary to check if the Navigation can go back using the property NavigationService.CanGoBack as shown below.

Programmatically Go Back to Previous Page in Windows Phone App

function void GoBack()
{
 if (this.NavigationService.CanGoBack)
 {
  this.NavigationService.GoBack();
 }
}