Class TabControl
Represents a control that contains multiple items that share the same space on the screen.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class TabControl : ItemsControl
Constructors
| Improve this Doc View SourceTabControl()
Initializes a new instance of the TabControl class.
Declaration
public TabControl()
Fields
| Improve this Doc View SourceSelectedContentProperty
Identifies the TabControl.SelectedContent dependency property.
Declaration
public static readonly DependencyProperty SelectedContentProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the TabControl.SelectedContent dependency property. |
SelectedIndexProperty
Identifies the TabControl.SelectedIndex dependency property.
Declaration
public static readonly DependencyProperty SelectedIndexProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the TabControl.SelectedIndex dependency property. |
SelectedItemProperty
Identifies the TabControl.SelectedItem dependency property.
Declaration
public static readonly DependencyProperty SelectedItemProperty
Field Value
Type | Description |
---|---|
DependencyProperty | The identifier for the TabControl.SelectedItem dependency property. |
TabStripPlacementProperty
Declaration
public static readonly DependencyProperty TabStripPlacementProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceSelectedContent
Gets the content of the currently selected TabItem.
Declaration
public object SelectedContent { get; }
Property Value
Type | Description |
---|---|
System.Object | The content of the currently selected TabItem. The default is null. |
SelectedIndex
Gets or sets the index of the currently selected TabItem.
Declaration
public int SelectedIndex { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The index of the currently selected TabItem, or -1 if a TabItem is not selected. |
SelectedItem
Gets or sets the currently selected TabItem.
Declaration
public object SelectedItem { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The currently selected TabItem, or null if a TabItem is not selected. |
TabStripPlacement
Declaration
public Dock TabStripPlacement { get; set; }
Property Value
Type | Description |
---|---|
Dock |
Methods
| Improve this Doc View SourceOnApplyTemplate()
Builds the visual tree for the TabControl when a new template is applied.
Declaration
public override void OnApplyTemplate()
Overrides
| Improve this Doc View SourceOnItemsChanged(NotifyCollectionChangedEventArgs)
Updates the current selection when Items has changed.
Declaration
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Specialized.NotifyCollectionChangedEventArgs | e | Data used by the event. |
Overrides
| Improve this Doc View SourceOnKeyDown(KeyEventArgs)
This is the method that responds to the KeyDown event.
Declaration
protected override void OnKeyDown(KeyEventArgs e)
Parameters
Type | Name | Description |
---|---|---|
KeyEventArgs | e | Data used by the event. |
Overrides
| Improve this Doc View SourceOnSelectionChanged(SelectionChangedEventArgs)
Raises the TabControl.SelectionChanged event.
Declaration
protected virtual void OnSelectionChanged(SelectionChangedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
SelectionChangedEventArgs | args | Provides data for the TabControl.SelectionChanged event. |
Events
| Improve this Doc View SourceSelectionChanged
Occurs when the selected TabItem changes.
Declaration
public event SelectionChangedEventHandler SelectionChanged
Event Type
Type | Description |
---|---|
SelectionChangedEventHandler |