public sealed class TabsA strip of tabs and the panels behind them.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
Two parts, and the tabs are not the parents of their panels. A tab is in the strip and its panel is below it, so the two cannot be one element — which is why AddTab exists and why Panel is a reference rather than a child.
⚠ The unselected panels stay in the tree with display: none. They keep their scroll position, their focus history and their state, and re-selecting a tab costs a restyle rather than a rebuild — which is what makes a tabbed inspector usable. The cost is that ten tabs is ten panels' worth of elements whether or not anybody looks at them, and a panel that is genuinely expensive should be built on first selection by the application. Said plainly rather than solved with a lazy mode nobody would find.
Arrows select rather than only moving the focus, for the reason a radio group's do: the strip is one tab stop, so a keyboard that could move without choosing could not choose at all.
Fields and properties (8)
protected override string TagNameThe element name this type answers to when a caller does not choose one.
protected override bool AcceptsFocusWhether the focus can rest on this kind of control at all.
public UiElement StripThe strip the headers are in.
public UiElement PanelsThe area the panels are in.
public IReadOnlyList<TabItem> ItemsThe tabs, in order.
public int SelectedIndexpublic TabItem? SelectedThe tab that is showing, if one is.
public static readonly UiPropertyKey SelectedIndexPropertyIdentity for SelectedIndex.
Events (1)
public Action<Tabs, int>? SelectionChangedRaised when a different tab is shown.
Methods (4)
protected override void OnCreated()Builds whatever this element is made of, once, as it joins a document.
public TabItem AddTab(string? label = null)Adds a tab and the panel behind it.
public bool RemoveTab(TabItem tab)Takes a tab and its panel out.
public void ClearSelectedIndex()Unsets SelectedIndex, so it takes its default or its ancestor's value again.
Used by (8)
- ShellHelloUi
- ControlVisualTestsVixen.Ui.Controls.Tests
- NavigationInteractionTestsVixen.Ui.Controls.Tests
- SelectionTestsVixen.Ui.Controls.Tests
- PrefabViewVixen.Editor.AssetEditors
- SceneEditorFactoryVixen.Editor.AssetEditors
- SpriteViewTestsVixen.Editor.AssetEditors.Tests
- TextureImportViewVixen.Editor.AssetEditors