In This Article

Tab Class

Represents a tab that appears within a Ribbon control.

[TemplatePart(Name = "PART_Label", Type = typeof(TextBlock))]
public class Tab : ButtonBase, IKeyTipTarget, ILogicalParent, IVariantControl
Inheritance:
object Visual UIElement FrameworkElement Control ControlBase ButtonBase object
Implements:
IKeyTipTarget ILogicalParent IVariantControl

Remarks

For detailed documentation on this control's features and how to use them, please see the Tab documentation topic.

Constructors

Tab()

Initializes an instance of the Tab class.

public Tab()

Properties

IsContextualTab

Gets whether the tab is a contextual tab contained within a ContextualTabGroup.

public bool IsContextualTab { get; }

Property Value

bool:

true if the tab is a contextual tab contained within a ContextualTabGroup; otherwise, false.

IsFirstTabInContextualTabGroup

Gets whether the tab is the first tab in a ContextualTabGroup.

public bool IsFirstTabInContextualTabGroup { get; }

Property Value

bool:

true if the tab is the first tab in a ContextualTabGroup; otherwise, false.

IsLastTabInContextualTabGroup

Gets whether the tab is the last tab in a ContextualTabGroup.

public bool IsLastTabInContextualTabGroup { get; }

Property Value

bool:

true if the tab is the last tab in a ContextualTabGroup; otherwise, false.

IsMinimized

Gets whether the tab is currently selected, but minimized.

public bool IsMinimized { get; }

Property Value

bool:

true if the tab is currently selected, but minimized; otherwise, false.

IsMouseOverTab

Gets whether the mouse is currently over the tab.

public bool IsMouseOverTab { get; }

Property Value

bool:

true if the mouse is currently over the tab; otherwise, false.

IsSelected

Gets whether the tab is selected.

public bool IsSelected { get; set; }

Property Value

bool:

true if the tab is selected; otherwise, false.

IsTextTruncated

Gets whether the text in the tab is truncated.

public bool IsTextTruncated { get; }

Property Value

bool:

true if the text in the tab is truncated; otherwise, false.

Items

Gets the RibbonControlCollection<Group> containing the group items for display for the tab.

public RibbonControlCollection<Group> Items { get; }

Property Value

RibbonControlCollection<Group>:

The RibbonControlCollection<Group> containing the group items for display for the tab.

LogicalChildren

Gets an enumerator for logical child elements of this element.

protected override IEnumerator LogicalChildren { get; }

Property Value

IEnumerator:

An enumerator for logical child elements of this element.

SeparatorOpacity

Gets the opacity level of the tab separator.

public double SeparatorOpacity { get; }

Property Value

double:

The opacity level of the tab separator.

Methods

MeasureOverride(Size)

When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.

protected override Size MeasureOverride(Size availableSize)
Parameter Type Description
availableSize Size

The available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.

Returns

Size:

The size that this element determines it needs during layout, based on its calculations of child element sizes.

OnAccessKey(AccessKeyEventArgs)

Responds when the access key for this control is invoked.

protected override void OnAccessKey(AccessKeyEventArgs e)
Parameter Type Description
e AccessKeyEventArgs

A AccessKeyEventArgs that contains the event data.

OnClick(ExecuteRoutedEventArgs)

Called when the control is clicked and a Click event is raised.

protected override void OnClick(ExecuteRoutedEventArgs e)
Parameter Type Description
e ExecuteRoutedEventArgs

An ExecuteRoutedEventArgs that contains the event data.

OnCreateAutomationPeer()

Creates and returns an AutomationPeer object for this type.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The AutomationPeer that was created.

OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs)

Occurs when the IsKeyboardFocused value is changed.

protected override void OnIsKeyboardFocusedChanged(DependencyPropertyChangedEventArgs e)
Parameter Type Description
e DependencyPropertyChangedEventArgs

A System.Windows.DependencyPropertyChangedEventArgs that contains the event data.

OnKeyTipAccessed(string)

Called when key tip access text for the control is typed by the end user.

protected override bool OnKeyTipAccessed(string keyTipAccessText)
Parameter Type Description
keyTipAccessText string

The key tip access text that was typed.

Returns

bool:

true if an action was executed that should stop key tip mode; otherwise, false.

Remarks

Implementations of this method should either execute the action associated with the control or move focus to the control so that the end user can take further action such as in a menu.

OnMouseLeave(MouseEventArgs)

Occurs when the mouse leaves the control.

protected override void OnMouseLeave(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnMouseLeftButtonDown(MouseButtonEventArgs)

Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.

protected override void OnMouseLeftButtonDown(MouseButtonEventArgs e)
Parameter Type Description
e MouseButtonEventArgs

The event data for the MouseLeftButtonDown event.

OnMouseMove(MouseEventArgs)

Invoked when an unhandled Mouse.MouseMoveEvent attached event is raised on this element. Implement this method to add class handling for this event.

protected override void OnMouseMove(MouseEventArgs e)
Parameter Type Description
e MouseEventArgs

A MouseEventArgs that contains the event data.

OnRenderSizeChanged(SizeChangedInfo)

Called when the rendered size of a control changes.

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
Parameter Type Description
sizeInfo SizeChangedInfo

Specifies the size changes.

Fields

IsContextualTabProperty

Identifies the IsContextualTab dependency property. This field is read-only.

public static readonly DependencyProperty IsContextualTabProperty

IsFirstTabInContextualTabGroupProperty

Identifies the IsFirstTabInContextualTabGroup dependency property. This field is read-only.

public static readonly DependencyProperty IsFirstTabInContextualTabGroupProperty

IsLastTabInContextualTabGroupProperty

Identifies the IsLastTabInContextualTabGroup dependency property. This field is read-only.

public static readonly DependencyProperty IsLastTabInContextualTabGroupProperty

IsMinimizedProperty

Identifies the IsMinimized dependency property. This field is read-only.

public static readonly DependencyProperty IsMinimizedProperty

IsMouseOverTabProperty

Identifies the IsMouseOverTab dependency property. This field is read-only.

public static readonly DependencyProperty IsMouseOverTabProperty

IsSelectedProperty

Identifies the IsSelected dependency property. This field is read-only.

public static readonly DependencyProperty IsSelectedProperty

IsTextTruncatedProperty

Identifies the IsTextTruncated dependency property. This field is read-only.

public static readonly DependencyProperty IsTextTruncatedProperty

SeparatorOpacityProperty

Identifies the SeparatorOpacity dependency property. This field is read-only.

public static readonly DependencyProperty SeparatorOpacityProperty

Inherited Members