Search code examples
c#uwpnavigationwindows-community-toolkituwp-navigation

UWP Frame backword navigation to partiular page


My UWP app has a flat/lateral structure. The complete app is 4 pages exist side-by-side.

PAGE A > PAGE B > CAMERA > EDIT IMAGE

PAGE > PAGE B Normal Flow

PAGE B > CAMERA PAGE > EDIT IMAGE PAGE

In PageB select record from the collection > capture Image > Edit image (add notes) after click on save move back to Page B.

How to come back to PageB after Captured Image is edited and save.

Do we have pre-defined events that differentiate the PageA > Page B navigation and EDIT IMAGE > PageB.

When I tried frame.goBack() camera page is opening. want to do one more level down.


Solution

  • How to come back to PageB after Captured Image is edited and save.

    For this scenario, you could remove CAMERA page from Navigate BackStack before back to PAGE B from EDIT IMAGE. Then it will skip CamearaPage.

    Frame.BackStack.Remove(Frame.BackStack.Where(a => a.SourcePageType == typeof(CAMERAPage)).FirstOrDefault());