Search code examples
c#uwpnavigationview

Can a navigationview communicate with the pages navigated to?


I'm using a navigationview and want to modify the window navigated to after my settings windows closes.

How can I get the instance of the navigated to page?

If that's not possible, how would I force the page closed so I can open a new instance. I've set the cache mode to 'required' and have the back button working fine but I can do a 'reload' of everything if needed. However, the back stack does not seem to include the currently shown page and I can't figure out how to close it.

All pages are opened like this: MainFrame.Navigate(typeof(PageA), PageSupportInstance );

The class PageSupportInstance has an update method in it that I would like to call in the ItemInvoked call back.

In my case I have PageA->PageB->PageC. I can clear the back stack but Page C would still be shown. Then if I navigate to PageA so it shows the update the back stack looks like this: PageA->PageA. Not ideal...


Solution

  • The answer is: you can't.

    Parameters can be passed to the new page so that will have to suffice. Can be a little klunky but it works.