I have right now a windows phone 8 application that uses cimbalino Toolkit navigation service in my View Model.
I have a MainPage and a AddItemPage. When a user add and item and hits the save button, I have it go back to the MainPage.
Now I want to remove the AddItemPage from the back stack. Yet I have no clue where to put "RemoveBackEntry".
RemoveBackEntryshould be in theMainPage.OnNavigatedTo. But this method is called every time MainPage is shown, so you have to check if last entry on the BackStack is really the page you should remove (e.g. by passing some parameter in the query string (which will be available in OnNavigatedTo) or by examining the entries in the BackStack).Much better approach would be to call
NavigationService.GoBack()after the save on theAddItemPage.