Hello,
Welcome to Microsoft Q&A!
To implement what you need in your scenario, you need to make sure the rootfame
handles all navigation actions, so when you click the backbutton, it can go back.
Here are the steps:
1) you need to handle the homepage_click
event inside the mainWindow.cs, not in the homepage. So that you could use the rootframe
object to navigate to the deletepage just like the same way you did for the homepage.
2) you need to handle the backbutton
event of the deletepage inside the mainWindow.cs, so you could use the rootframe
object and call the rootframe.goback() method to navigate back.
Besides, the simplest way is that do not add navigate button inside these sub pages. Handle the navigationview's iteminvoke event to navigate to different subpages when users click on the NavigationViewItem
. You could easily access the rootframe
to control all the navigation actions.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.