feat: try to setup communication.

This commit is contained in:
rabbitism
2024-02-12 00:10:33 +08:00
parent 49fdf80b7b
commit 5e5e0844e1
2 changed files with 68 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
using Avalonia.LogicalTree;
namespace Ursa.Controls;
@@ -14,4 +15,18 @@ public class NavMenu: SelectingItemsControl
{
return new NavMenuItem();
}
internal void SelectItem(NavMenuItem item)
{
if (item.IsSelected) return;
var children = this.LogicalChildren.OfType<NavMenuItem>();
foreach (var child in children)
{
if (child != item)
{
child.IsSelected = false;
}
}
item.IsSelected = true;
}
}