We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The SelectionChanged event in the NavigationView control does not fire when a new item is selected.
The SelectionChanged event should fire each time a different item is selected, allowing appropriate handling of the selection change.
No response
Windows 11 pro 23H2
.NET 8
WPF-UI 3.0.5
<ui:NavigationView x:Name="sidebarNavigationView" IsPaneToggleVisible="True" OpenPaneLength="130" SelectionChanged="sidebarNavigationView_SelectionChanged"> <ui:NavigationView.MenuItems> <ui:NavigationViewItem Content="Collections"> <ui:NavigationViewItem.Icon> <ui:SymbolIcon Style="{StaticResource LargeSymbolIconStyle}" Symbol="Folder48" /> </ui:NavigationViewItem.Icon> </ui:NavigationViewItem> <ui:NavigationViewItem Content="Environments"> <ui:NavigationViewItem.Icon> <ui:SymbolIcon Style="{StaticResource LargeSymbolIconStyle}" Symbol="AppsListDetail24" /> </ui:NavigationViewItem.Icon> </ui:NavigationViewItem> <ui:NavigationViewItem Content="History"> <ui:NavigationViewItem.Icon> <ui:SymbolIcon Style="{StaticResource LargeSymbolIconStyle}" Symbol="History48" /> </ui:NavigationViewItem.Icon> </ui:NavigationViewItem> </ui:NavigationView.MenuItems> <ui:NavigationView.FooterMenuItems> <ui:NavigationViewItem Content="Settings"> <ui:NavigationViewItem.Icon> <ui:SymbolIcon Symbol="Settings24" /> </ui:NavigationViewItem.Icon> </ui:NavigationViewItem> </ui:NavigationView.FooterMenuItems> </ui:NavigationView>
private void sidebarNavigationView_SelectionChanged(NavigationView sender, RoutedEventArgs args) { System.Windows.MessageBox.Show("Selection changed ! "); }
The text was updated successfully, but these errors were encountered:
You need to set the TargetPageType property of NavigationViewItem to properly trigger the SelectionChanged event
TargetPageType
NavigationViewItem
SelectionChanged
Sorry, something went wrong.
Anyway, this is unreasonable. Why does TargetPageType=null affect the SelectionChanged event of NavigationViewItem?
Do you have a three-level NavigationViewItem ?
No branches or pull requests
Describe the bug
The SelectionChanged event in the NavigationView control does not fire when a new item is selected.
To Reproduce
Expected behavior
The SelectionChanged event should fire each time a different item is selected, allowing appropriate handling of the selection change.
Screenshots
No response
OS version
Windows 11 pro 23H2
.NET version
.NET 8
WPF-UI NuGet version
WPF-UI 3.0.5
Additional context
private void sidebarNavigationView_SelectionChanged(NavigationView sender, RoutedEventArgs args)
{
System.Windows.MessageBox.Show("Selection changed ! ");
}
The text was updated successfully, but these errors were encountered: