Docs / UI

Glossary: TabControl

The members of TabControl, in alphabetical order.

Color legend plain property method event

Not an element but a helper: it pairs tab elements with content elements and shows only the content of the open tab. You place the tabs and the contents yourself, for example buttons in a stack panel and the pages in one grid cell.

A class deriving from DisposableBase. The layout page shows it in context.

Names are colored by what they are: a property, a method or an event; values and fields keep the plain color.

Properties

CurrentOpenedContent 🠆

BaseElement · Read-only. The content of the open tab, the only one shown, or null.

CurrentTab 🠆

BaseElement · Read-only. The open tab, or null when there is none.

Methods

TabControl() 🠆

TabControl() · Creates a tab control without tabs.

AddTab() 🠆

AddTab(BaseElement tab, BaseElement content) · Adds a tab and its content; the content is hidden unless this is the first tab. Adding a tab again replaces its content. Null arguments are ignored.

Parameter Type Description
tab BaseElement The element pressed to open the tab, such as a button.
content BaseElement The element shown while the tab is open.

OpenTab() 🠆

OpenTab(BaseElement tab) · Opens the tab, showing its content and hiding the open one. Does nothing for an element that isn’t a tab of this control.

Parameter Type Description
tab BaseElement The tab to open, an element added with AddTab.

RemoveTab() 🠆

RemoveTab(BaseElement tab) · Removes the tab. When it was open, its neighbor opens. Its content is visible again.

Parameter Type Description
tab BaseElement The tab to remove.

Events

OnTabOpened 🠆

(TabControl sender, BaseElement tab) · Another tab opens: pressed, opened with OpenTab, the first one added, or the neighbor of a removed open tab. tab is null when the last tab was removed.

Parameter Type Description
sender TabControl The tab control.
tab BaseElement The tab that opened, or null when the last tab was removed.