Class TabItem
Represents a selectable item in a TabControl.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class TabItem : ContentControl
Constructors
| Improve this Doc View SourceTabItem()
Initializes a new instance of the TabItem class.
Declaration
public TabItem()
Fields
| Improve this Doc View SourceHasHeaderProperty
Identifies the HasHeader dependency property.
Declaration
public static readonly DependencyProperty HasHeaderProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the HasHeader dependency property. |
HeaderProperty
Identifies the Header dependency property.
Declaration
public static readonly DependencyProperty HeaderProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the Header dependency property. |
HeaderTemplateProperty
Identifies the HeaderTemplate dependency property.
Declaration
public static readonly DependencyProperty HeaderTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the HeaderTemplate dependency property. |
IsFocusedProperty
Identifies the IsFocused dependency property.
Declaration
public static readonly DependencyProperty IsFocusedProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the IsFocused dependency property. |
IsSelectedProperty
Identifies the IsSelected dependency property.
Declaration
public static readonly DependencyProperty IsSelectedProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the IsSelected dependency property. |
SelectedAccentProperty
Identifies the SelectedAccent dependency property
Declaration
public static readonly DependencyProperty SelectedAccentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectedBackgroundProperty
Identifies the SelectedBackground dependency property
Declaration
public static readonly DependencyProperty SelectedBackgroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
SelectedForegroundProperty
Identifies the SelectedForeground dependency property
Declaration
public static readonly DependencyProperty SelectedForegroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceHasHeader
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. |
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. |
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. |
IsFocused
Gets a value indicating whether this element has logical focus.
Declaration
public bool IsFocused { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
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. |
SelectedAccent
Gets or sets the accent color of the selected INTERNAL_CorrespondingItem.
Declaration
public Brush SelectedAccent { get; set; }
Property Value
Type | Description |
---|---|
Brush |
SelectedBackground
Gets or sets the bakground color of the selected INTERNAL_CorrespondingItem.
Declaration
public Brush SelectedBackground { get; set; }
Property Value
Type | Description |
---|---|
Brush |
SelectedForeground
Gets or sets the foreground color of the selected INTERNAL_CorrespondingItem.
Declaration
public Brush SelectedForeground { get; set; }
Property Value
Type | Description |
---|---|
Brush |
Methods
| Improve this Doc View SourceOnApplyTemplate()
Builds the visual tree for the TabItem when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnContentChanged(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
| Improve this Doc View SourceOnHeaderChanged(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. |
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. |
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. |
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. |
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. |