Добавлен проект UI

This commit is contained in:
2026-01-07 22:33:42 +03:00
parent b6de0543b7
commit ca5d912c9c
21 changed files with 1188 additions and 4 deletions

View File

@@ -0,0 +1,43 @@
using Lattice.Core.Abstractions;
using Microsoft.UI.Xaml.Controls;
namespace Lattice.UI.Controls;
/// <summary>
/// Расширенный TabView для центральной области Lattice.
/// </summary>
public class LatticeTabStrip : TabView
{
private IContextService? _contextService;
public LatticeTabStrip()
{
this.TabCloseRequested += (s, e) =>
{
// Логика удаления вкладки из коллекции
this.TabItems.Remove(e.Tab);
// Если вкладок не осталось, сбрасываем контекст
if (this.TabItems.Count == 0)
{
_contextService?.SetContext("Common");
}
};
}
public void Initialize(IContextService contextService)
{
_contextService = contextService;
this.SelectionChanged += OnSelectionChanged;
}
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (this.SelectedItem is IDockableComponent component)
{
// Уведомляем ядро о смене контекста для обновления кнопок
_contextService?.SetContext(component.ContextGroup);
}
}
}