This commit is contained in:
CortexCore
2024-08-08 23:07:50 +08:00
parent dffda3663b
commit 5038fe33d1
9 changed files with 66 additions and 22 deletions

View File

@@ -40,6 +40,18 @@ namespace BITKit.UX
public new class UxmlFactory : UxmlFactory<TabBar, UxmlTraits> { }
// These are USS class names for the control overall and the label.
public TabBar()
{
RegisterCallback<AttachToPanelEvent>(UpdateI);
RegisterCallback<DetachFromPanelEvent>(UpdateI);
RegisterCallback<GeometryChangedEvent>(UpdateI);
}
private void UpdateI(object _)
{
CurrentTab = _currentTab;
}
public event Action<int> OnTabChanged;
private Button[] _buttons = Array.Empty<Button>();