Hello,
Welcome to Microsoft Q&A!
If I understand you correctly, what you want to do is to navigate to a page via code. If it is, what you need is to set the NavigationView.SelectedItem property
. You could set the target NavigationViewItem to the NavigationView.SelectedItem property
. Then the NavigationView.SelectionChanged event
will be triggered and the navigation will happen.
Like this:
// Itme3 is a NavigationViewItem that I created in the Xaml
nvSample().SelectedItem(Item3());
If your NavigationViewItem is not created in Xaml, you might need to find it in NavigationView.MenuItems Property
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.