Back button always returns to start page in UWP Template10 App

119 Views Asked by At

We have a UWP app that uses Template10. Our landing page is JobPage. We use ViewModelNavigation in the form

public void GoToCustomerPage() => NavigationService.Navigate(typeof(Views.CustomerPage));

If we navigate from the JobPage to the OrderPage and from the OrderPage to the CustomerPage then click the Back button we expect to return to the OrderPage but instead we return to the JobPage.

In the CustomerPageViewModel in OnNavigatingFromAsync the NavigationService.NavigationState is

1,3,2,17,UWP.Views.JobPage,0,0,19,UWP.Views.OrderPage,0,0,22,UWP.Views.CustomerPage,0,0

There is nothing in OnNavigatingFromAsyncon the CustomerPageViewModel to redirect navigation to the JobPage. There is nothing in OnNavigatedToAsync on the OrderPageViewModel that redirects to the JobPage. OrderPage.OnNavigatedToAsync is not even hit.

Why is it when we click the Back button on the CustomerPage we go back to the JobPage and not the OrderPage?

EDIT 1: I have created a sample that demonstrates this issue here

EDIT 2: I have referenced this issue on the Template 10 repo Issue with the Navigation service

0

There are 0 best solutions below