Backward Navigation in Windows Phone App

The NavigationService in Windows Phone 8 exposes the method GoBack () which lets the users to move back to the previous page in the page history stack.

Backward Navigation in Windows Phone App

Below is a sample code snippet demonstrating the Backward Navigation in Windows Phone App.

using System;

using System.Collections.Generic;

using System.Linq;

using System.Net;

using System.Windows;

using System.Windows.Controls;

using System.Windows.Navigation;

using Microsoft.Phone.Controls;

using Microsoft.Phone.Shell;

namespace AbundantCodeWP8

{

public partial class ACCode : PhoneApplicationPage

{

public ACCode()

{

InitializeComponent();

}

private void Button_Click(object sender, RoutedEventArgs e)

{

if(NavigationService.CanGoBack)

NavigationService.GoBack();

}

}

}