I'm using Windows Template Studio, and created a NavigationView.
My original thought is creating a navigatoin menu like Android, when pressing the Left button in a page, open the navigation menu, and focus on the corresponding item.
For example, When I'm in Settings page, and current focus in on a Button. When I press Left button, the NavigationView opens and focus on the Settings item.
But now the focus always on the first item, and then go to the corresponding item.
Here is the repo that can reproduce the bug, you can run it on pc/xbox.
You can see the video here.
So how to avoid the first navigationview item focused when opening?

This seems to be a default behavior, because the focus of your
NavigationViewItemis set manually, before setting the focus of a specific item, it does not prevent the default focus behavior ofNavigationView, like this:NavigationViewPaneOpenedevent.This operation will indeed cause a focus jump. In order to avoid this, we need to judge when the first item gets focus (using
strNaviTagas a reference):ShellPage.xaml
ShellPage.xaml.cs
This prevents the first item from gaining focus when the requirements are not met.
Thanks.