diff --git a/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs b/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs index 8d27b8904862..31af2550227a 100644 --- a/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs +++ b/src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs @@ -141,8 +141,22 @@ private void OnNavigationTabChanged(NavigationView sender, NavigationViewSelecti var selectedItem = (NavigationViewItemViewModel)args.SelectedItem; - if (selectedItem.Data is ShellSection shellSection) + if (selectedItem.Data is ShellSection shellSection && VirtualView.Parent is Shell shell) { + NavigationViewItemViewModel? currentItem = null; + foreach (var item in _mainLevelTabs) + { + if (shell.CurrentItem?.CurrentItem is not null && item.Data == shell.CurrentItem.CurrentItem) + { + currentItem = item; + break; + } + } + if (PlatformView is NavigationView navView && navView?.SelectedItem is not null && navView.SelectedItem != currentItem) + { + ((IShellItemController)shell.CurrentItem!).ProposeSection(shellSection); + } + ((Shell)VirtualView.Parent).CurrentItem = shellSection; } else if (selectedItem.Data is ShellContent shellContent) diff --git a/src/Controls/tests/TestCases.HostApp/Issues/Issue25599.xaml b/src/Controls/tests/TestCases.HostApp/Issues/Issue25599.xaml new file mode 100644 index 000000000000..97250e40d3ed --- /dev/null +++ b/src/Controls/tests/TestCases.HostApp/Issues/Issue25599.xaml @@ -0,0 +1,36 @@ + + + + + + + + + +