Show / Hide Table of Contents

Class TabItem

Represents a selectable item in a TabControl.

Inheritance
System.Object
DependencyObject
UIElement
FrameworkElement
Control
ContentControl
TabItem
Inherited Members
ContentControl.Content
ContentControl.ContentProperty
ContentControl.ContentTemplate
ContentControl.ContentTemplateProperty
ContentControl.LogicalChildren
Control.EnableBaseControlHandlingOfVisualStates
Control.ManageIsEnabled(Boolean)
Control.Background
Control.BackgroundProperty
Control.BorderBrush
Control.BorderBrushProperty
Control.BorderThickness
Control.BorderThicknessProperty
Control.FontWeight
Control.FontWeightProperty
Control.FontStyle
Control.FontStyleProperty
Control.Foreground
Control.ForegroundProperty
Control.FontFamily
Control.FontFamilyProperty
Control.FontSize
Control.FontSizeProperty
Control.TextDecorations
Control.TextDecorationsProperty
Control.Padding
Control.PaddingProperty
Control.HorizontalContentAlignment
Control.HorizontalContentAlignmentProperty
Control.VerticalContentAlignment
Control.VerticalContentAlignmentProperty
Control.TabIndex
Control.TabIndexProperty
Control.IsTabStop
Control.IsTabStopProperty
Control.TabNavigation
Control.TabNavigationProperty
Control.Template
Control.TemplateProperty
Control.ApplyTemplate()
Control.GetTemplateChild(String)
Control.Focus()
Control.HandlesScrolling
Control.OnGotFocus(RoutedEventArgs)
Control.OnLostFocus(RoutedEventArgs)
Control.CreateDomElement(Object, Object)
Control.CharacterSpacingProperty
Control.CharacterSpacing
Control.FontStretchProperty
Control.FontStretch
Control.OnDrop(DragEventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragLeave(DragEventArgs)
Control.OnTextInputUpdate(TextCompositionEventArgs)
Control.MeasureOverride(Size)
Control.ArrangeOverride(Size)
FrameworkElement.LayoutUpdated
FrameworkElement.SizeChanged
FrameworkElement.ResourceLookupMode
FrameworkElement.StyleProperty
FrameworkElement.Style
FrameworkElement.DefaultStyleKeyProperty
FrameworkElement.DefaultStyleKey
FrameworkElement.OverridesDefaultStyleProperty
FrameworkElement.OverridesDefaultStyle
FrameworkElement.OnVisualParentChanged(DependencyObject)
FrameworkElement.VisualChildrenCount
FrameworkElement.GetVisualChild(Int32)
FrameworkElement.Parent
FrameworkElement.AddLogicalChild(Object)
FrameworkElement.RemoveLogicalChild(Object)
FrameworkElement.TemplatedParent
FrameworkElement.Resources
FrameworkElement.IsLoaded
FrameworkElement.SetBinding(DependencyProperty, BindingBase)
FrameworkElement.SetBinding(DependencyProperty, Binding)
FrameworkElement.GetBindingExpression(DependencyProperty)
FrameworkElement.Cursor
FrameworkElement.CursorProperty
FrameworkElement.FindName(String)
FrameworkElement.Name
FrameworkElement.NameProperty
FrameworkElement.DataContext
FrameworkElement.DataContextProperty
FrameworkElement.DataContextChanged
FrameworkElement.Triggers
FrameworkElement.FlowDirectionProperty
FrameworkElement.FlowDirection
FrameworkElement.LanguageProperty
FrameworkElement.Language
FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
FrameworkElement.Tag
FrameworkElement.TagProperty
FrameworkElement.LoadedEvent
FrameworkElement.Loaded
FrameworkElement.Unloaded
FrameworkElement.BindingValidationError
FrameworkElement.ContextMenuProperty
FrameworkElement.ContextMenu
FrameworkElement.ContextMenuOpening
FrameworkElement.ToolTipProperty
FrameworkElement.ToolTip
FrameworkElement.INTERNAL_OnDetachedFromVisualTree()
FrameworkElement.INTERNAL_OnAttachedToVisualTree()
FrameworkElement.Height
FrameworkElement.HeightProperty
FrameworkElement.Width
FrameworkElement.WidthProperty
FrameworkElement.HorizontalAlignment
FrameworkElement.HorizontalAlignmentProperty
FrameworkElement.VerticalAlignment
FrameworkElement.VerticalAlignmentProperty
FrameworkElement.Margin
FrameworkElement.MarginProperty
FrameworkElement.MinHeight
FrameworkElement.MinHeightProperty
FrameworkElement.MinWidth
FrameworkElement.MinWidthProperty
FrameworkElement.MaxHeight
FrameworkElement.MaxHeightProperty
FrameworkElement.MaxWidth
FrameworkElement.MaxWidthProperty
FrameworkElement.ActualWidthProperty
FrameworkElement.ActualWidth
FrameworkElement.ActualHeightProperty
FrameworkElement.ActualHeight
UIElement.TransformToVisual(UIElement)
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Controls
Assembly: OpenSilver.Controls.dll
Syntax
[TemplatePart(Name = "TemplateTopSelected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateBottomSelected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateLeftSelected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateRightSelected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateTopUnselected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateBottomUnselected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateLeftUnselected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "TemplateRightUnselected", Type = typeof(FrameworkElement))]
[TemplatePart(Name = "HeaderTopSelected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderBottomSelected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderLeftSelected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderRightSelected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderTopUnselected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderBottomUnselected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderLeftUnselected", Type = typeof(ContentControl))]
[TemplatePart(Name = "HeaderRightUnselected", Type = typeof(ContentControl))]
public class TabItem : ContentControl, IControl, IFrameworkElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

TabItem()

Initializes a new instance of the TabItem class.

Declaration
public TabItem()

Fields

| Improve this Doc View Source

HasHeaderProperty

Identifies the HasHeader dependency property.

Declaration
public static readonly DependencyProperty HasHeaderProperty
Field Value
Type Description
DependencyProperty

The identifier for the HasHeader dependency property.

| Improve this Doc View Source

HeaderProperty

Identifies the Header dependency property.

Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
Type Description
DependencyProperty

The identifier for the Header dependency property.

| Improve this Doc View Source

HeaderTemplateProperty

Identifies the HeaderTemplate dependency property.

Declaration
public static readonly DependencyProperty HeaderTemplateProperty
Field Value
Type Description
DependencyProperty

The identifier for the HeaderTemplate dependency property.

| Improve this Doc View Source

IsFocusedProperty

Identifies the IsFocused dependency property.

Declaration
public static readonly DependencyProperty IsFocusedProperty
Field Value
Type Description
DependencyProperty

The identifier for the IsFocused dependency property.

| Improve this Doc View Source

IsSelectedProperty

Identifies the IsSelected dependency property.

Declaration
public static readonly DependencyProperty IsSelectedProperty
Field Value
Type Description
DependencyProperty

The identifier for the IsSelected dependency property.

Properties

| Improve this Doc View Source

HasHeader

Gets a value indicating whether the TabItem has a header.

Declaration
public bool HasHeader { get; }
Property Value
Type Description
System.Boolean

True if Header is not null; otherwise, false.

| Improve this Doc View Source

Header

Gets or sets the header of the TabItem.

Declaration
public object Header { get; set; }
Property Value
Type Description
System.Object

The current header of the TabItem.

| Improve this Doc View Source

HeaderTemplate

Gets or sets the template that is used to display the content of the TabItem header.

Declaration
public DataTemplate HeaderTemplate { get; set; }
Property Value
Type Description
DataTemplate

The current template that is used to display TabItem header content.

| Improve this Doc View Source

IsFocused

Gets a value indicating whether this element has logical focus.

Declaration
public bool IsFocused { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

IsSelected

Gets or sets a value indicating whether the TabItem is currently selected.

Declaration
public bool IsSelected { get; set; }
Property Value
Type Description
System.Boolean

True if the TabItem is selected; otherwise, false.

| Improve this Doc View Source

TabStripPlacement

Gets the location of the tab strip relative to the TabItem content.

Declaration
public Dock TabStripPlacement { get; }
Property Value
Type Description
Dock

The location of the tab strip relative to the TabItem content.

Methods

| Improve this Doc View Source

OnApplyTemplate()

Builds the visual tree for the TabItem when a new template is applied.

Declaration
public override void OnApplyTemplate()
Overrides
Control.OnApplyTemplate()
| Improve this Doc View Source

OnContentChanged(Object, Object)

This method is invoked when the Content property changes.

Declaration
protected override void OnContentChanged(object oldContent, object newContent)
Parameters
Type Name Description
System.Object oldContent

The previous TabItem content.

System.Object newContent

The new TabItem content.

Overrides
ContentControl.OnContentChanged(Object, Object)
| Improve this Doc View Source

OnCreateAutomationPeer()

Creates and returns an AutomationPeer for this TabItem.

Declaration
protected override AutomationPeer OnCreateAutomationPeer()
Returns
Type Description
AutomationPeer

An automation peer for this TabItem.

Overrides
UIElement.OnCreateAutomationPeer()
| Improve this Doc View Source

OnHeaderChanged(Object, Object)

Called when the Header property changes.

Declaration
protected virtual void OnHeaderChanged(object oldHeader, object newHeader)
Parameters
Type Name Description
System.Object oldHeader

The previous value of the Header property.

System.Object newHeader

The new value of the Header property.

| Improve this Doc View Source

OnHeaderTemplateChanged(DataTemplate, DataTemplate)

Called when the HeaderTemplate property changes.

Declaration
protected virtual void OnHeaderTemplateChanged(DataTemplate oldHeaderTemplate, DataTemplate newHeaderTemplate)
Parameters
Type Name Description
DataTemplate oldHeaderTemplate

The previous value of the HeaderTemplate property.

DataTemplate newHeaderTemplate

The new value of the HeaderTemplate property.

| Improve this Doc View Source

OnIsFocusChanged(DependencyPropertyChangedEventArgs)

Called when the IsFocused property changes.

Declaration
protected virtual void OnIsFocusChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type Name Description
DependencyPropertyChangedEventArgs e

A DependencyPropertyChangedEventArgs that contains the event data.

| Improve this Doc View Source

OnKeyDown(KeyEventArgs)

This is the method that responds to the KeyDown event.

Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type Name Description
KeyEventArgs e

A KeyEventArgs that contains the event data.

Overrides
UIElement.OnKeyDown(KeyEventArgs)
| Improve this Doc View Source

OnSelected(RoutedEventArgs)

Called to indicate that the IsSelected property has changed to true.

Declaration
protected virtual void OnSelected(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

A RoutedEventArgs that contains the event data.

| Improve this Doc View Source

OnUnselected(RoutedEventArgs)

Called to indicate that the IsSelected property has changed to false.

Declaration
protected virtual void OnUnselected(RoutedEventArgs e)
Parameters
Type Name Description
RoutedEventArgs e

A RoutedEventArgs that contains the event data.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
VisualTreeExtensions.GetBoundsRelativeTo(FrameworkElement, UIElement)
VisualTreeExtensions.InvokeOnLayoutUpdated(FrameworkElement, Action)
  • Improve this Doc
  • View Source