Table of Contents

Class TabControl

Namespace
Myra.Graphics2D.UI
Assembly
Myra.dll

A tab control widget that displays multiple tab items with selector buttons and swappable content panels.

public class TabControl : Selector<Grid, TabItem>, IItemWithId, INotifyAttachedPropertyChanged
Inheritance
TabControl
Implements
Inherited Members

Constructors

TabControl(Stylesheet, string)

Initializes a new instance of the TabControl class with the specified stylesheet and style.

public TabControl(Stylesheet stylesheet, string styleName = "")

Parameters

stylesheet Stylesheet

The stylesheet to use for applying the style.

styleName string

The name of the style to apply to the tab control.

TabControl(string)

Initializes a new instance of the TabControl class.

public TabControl(string styleName = "")

Parameters

styleName string

The name of the style to apply to the tab control.

Properties

ClipToBounds

Gets or sets a value indicating whether content extending beyond the tab control bounds is clipped.

public override bool ClipToBounds { get; set; }

Property Value

bool

CloseableTabs

Gets or sets a value indicating whether each tab has a close button.

public bool CloseableTabs { get; set; }

Property Value

bool

HorizontalAlignment

Gets or sets the horizontal alignment of the tab control within its parent container.

public override HorizontalAlignment HorizontalAlignment { get; set; }

Property Value

HorizontalAlignment

SelectionMode

Gets or sets the selection mode for tabs.

[Browsable(false)]
public override SelectionMode SelectionMode { get; set; }

Property Value

SelectionMode

TabControlStyle

Gets or sets the style applied to the tab control.

[Browsable(false)]
public TabControlStyle TabControlStyle { get; set; }

Property Value

TabControlStyle

TabSelectorPosition

Gets or sets the position of the tab selector buttons (top, bottom, left, or right).

public TabSelectorPosition TabSelectorPosition { get; set; }

Property Value

TabSelectorPosition

VerticalAlignment

Gets or sets the vertical alignment of the tab control within its parent container.

public override VerticalAlignment VerticalAlignment { get; set; }

Property Value

VerticalAlignment

Methods

ApplyStyle(WidgetStyle)

Applies the specified widget style to this tab control.

protected override void ApplyStyle(WidgetStyle style)

Parameters

style WidgetStyle

The widget style to apply.

CopyFrom(Widget)

Copies the tab control properties and items from another tab control.

protected override void CopyFrom(Widget w)

Parameters

w Widget

The source tab control to copy from.

InsertItem(TabItem, int)

Inserts a tab item at the specified index in the tab control.

protected override void InsertItem(TabItem item, int index)

Parameters

item TabItem

The tab item to insert.

index int

The zero-based index where the item should be inserted.

OnSelectedItemChanged()

Called when the selected tab item changes. Updates the displayed content.

protected override void OnSelectedItemChanged()

RemoveItem(TabItem)

Removes the specified tab item from the tab control.

protected override void RemoveItem(TabItem item)

Parameters

item TabItem

The tab item to remove.

Reset()

Clears all tab items from the tab control.

protected override void Reset()