sidy3d
sidy3d

Reputation: 549

Frame navigation in Windows runtime does not work

I have a windows runtime app that uses the frame control to navigate. I have a problem with the back button though. Consider this:

MainPage (this is the launch page of the app) ListPage (this page displays a list) DetailsPage (shows details about the selected item from the list page.

When I click on back on the details page it skips back to the main page instead of going to the list page. Any help would be appreciated.

Thanks,

Upvotes: 0

Views: 507

Answers (1)

Romasz
Romasz

Reputation: 29792

I suspect that the problem concerns double navigation - your frame.GoBack() is called twice - once by NavigationHelper (which subscribes to HardwareButtons.BackPressed) and twice by EventHandler subscribed in App.xaml.cs.

Remove susbscription from App.xaml.cs and check if that helped:

public App()
{
    this.InitializeComponent();
    this.Suspending += OnSuspending;
  //  HardwareButtons.BackPressed += HardwareButtons_BackPressed; // this line also fires frame.GoBack() (as default project template)
}

Upvotes: 2

Related Questions