feat: stop changing selection after checking canselect. revert focus change in this case.

This commit is contained in:
Dong Bin
2025-06-12 19:30:14 +08:00
parent 0e83446cb6
commit fb9f03d63b
3 changed files with 19 additions and 9 deletions

View File

@@ -381,6 +381,10 @@ public class NavMenuItem : HeaderedItemsControl
internal void SelectItem(NavMenuItem item)
{
if (item == this && RootMenu?.CanChangeSelection(item) != true)
{
return;
}
SetCurrentValue(IsSelectedProperty, item == this);
SetCurrentValue(IsHighlightedProperty, true);