Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/Controls/src/Core/Handlers/Shell/ShellItemHandler.Windows.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,28 @@ private void OnNavigationTabChanged(NavigationView sender, NavigationViewSelecti
if (currentItem?.Title != shellContent.Title && currentItem != shellContent.Parent)
{
(parentShell.CurrentItem as IShellItemController)?.ProposeSection(shellContent);
parentShell.CurrentItem = shellContent;
}
else if (shellContent.Parent is ShellSection existingSection && existingSection.CurrentItem != shellContent && existingSection.IsVisibleSection)
{
// Fire OnNavigatingFrom before CurrentItem changes, so it captures the correct outgoing page.
parentShell.NavigationManager.ProposeNavigationOutsideGotoAsync(
ShellNavigationSource.ShellContentChanged,
parentShell.CurrentItem,
existingSection,
shellContent,
existingSection.Stack,
canCancel: false,
isAnimated: true);

// Set ShellSection.CurrentItem directly (using SetValueFromRenderer) to avoid
// re-triggering the mistimed-navigation bug via CreateFromShellContent.
existingSection.SetValueFromRenderer(ShellSection.CurrentItemProperty, shellContent);
}
else
{
parentShell.CurrentItem = shellContent;
}
parentShell.CurrentItem = shellContent;
}
}

Expand Down Expand Up @@ -344,7 +364,7 @@ void UpdateSearchHandler()
autoSuggestBox.UpdateSearchHandlerBackground(_currentSearchHandler);
autoSuggestBox.UpdateSearchHandlerVerticalTextAlignment(_currentSearchHandler);
autoSuggestBox.UpdateSearchHandlerHorizontalTextAlignment(_currentSearchHandler);

_currentSearchHandler.PropertyChanged += OnCurrentSearchHandlerPropertyChanged;

autoSuggestBox.Visibility = _currentSearchHandler.SearchBoxVisibility == SearchBoxVisibility.Hidden ? Microsoft.UI.Xaml.Visibility.Collapsed : Microsoft.UI.Xaml.Visibility.Visible;
Expand Down
Loading