AdvancedTabControl Class
Represents a tab control with advanced features.
[TemplatePart(Name = "PART_ButtonsPanel", Type = typeof(Panel))]
[TemplatePart(Name = "PART_MenuButton", Type = typeof(PopupButton))]
[TemplatePart(Name = "PART_NewTabButton", Type = typeof(NewTabButton))]
[TemplatePart(Name = "PART_SelectedContentHost", Type = typeof(ContentPresenter))]
[TemplateVisualState(Name = "TabStripBottom", GroupName = "TabStripPlacementStates")]
[TemplateVisualState(Name = "TabStripLeft", GroupName = "TabStripPlacementStates")]
[TemplateVisualState(Name = "TabStripRight", GroupName = "TabStripPlacementStates")]
[TemplateVisualState(Name = "TabStripTop", GroupName = "TabStripPlacementStates")]
public class AdvancedTabControl : TabControl
- Inheritance:
- object Visual UIElement FrameworkElement Control ItemsControl Selector TabControl object
Constructors
AdvancedTabControl()
Initializes an instance of the class.
public AdvancedTabControl()
Properties
AreScrollButtonsVisible
Indicates whether the scroll buttons are visible.
AreTabEmbeddedButtonsAlwaysVisible
Indicates whether tab embedded buttons are always visible, even when the tab is unselected.
public bool AreTabEmbeddedButtonsAlwaysVisible { get; set; }
Property Value
- bool:
The default value is
false.
CanScrollBackward
Indicates whether scrolling backward is supported.
public bool CanScrollBackward { get; }
Property Value
- bool:
trueif scrolling backward is supported; otherwise,false. The default value isfalse.
CanScrollForward
Indicates whether scrolling forward is supported.
public bool CanScrollForward { get; }
Property Value
- bool:
trueif scrolling forward is supported; otherwise,false. The default value isfalse.
CanTabsCloseOnMiddleClick
Indicates whether tabs can close when a middle-click is performed over them.
public bool CanTabsCloseOnMiddleClick { get; set; }
Property Value
- bool:
The default value is
false.
Remarks
The CanClose property must also be set to true for this behavior to work.
CanTabsDrag
Indicates whether the dragging of tabs to reorder is enabled.
CanTabsHighlightOnPointerOverWhenInactive
Indicates whether tabs can highlight when the pointer is over inactive ones.
public bool CanTabsHighlightOnPointerOverWhenInactive { get; set; }
Property Value
- bool:
The default value is
false.
CanTabsPin
Indicates whether tabs display an embedded pin button.
CanTabsPromote
Indicates whether tabs display an embedded promote from preview layout kind button.
CanTabsSelectOnDragOver
Indicates whether tabs can be selected when performing a system (e.g. text, file) drag over them.
EmbeddedButtonStyle
The Style to use for embedded buttons.
HasNewTabButton
Indicates whether a new tab button is available.
HasTabCloseButtons
Indicates whether tabs have an embedded close button.
public bool HasTabCloseButtons { get; set; }
Property Value
- bool:
The default value is
false.
Remarks
The CanClose property must also be set to true for the button to show.
HasTabImages
Indicates whether tabs display an embedded image when one is available.
HeaderBackground
The background Brush for the header area behind the tabs and buttons.
HighlightBrushActive
The Brush to use for rendering an active highlight effect around the content border.
HighlightBrushInactive
The Brush to use for rendering an inactive highlight effect around the content border.
HighlightThickness
The thickness of the highlight effect around the content border.
IsActive
Indicates whether the tab control is active, generally meaning it contains focus.
IsLayoutAnimationEnabled
Indicates whether animation effects are applied during layout, such as when tabs are added or removed.
public bool IsLayoutAnimationEnabled { get; set; }
Property Value
- bool:
trueif animation effects are applied during layout, such as when tabs are added or removed; otherwise,false. The default value istrue.
IsMenuButtonVisible
Indicates whether the drop-down menu button is visible.
IsOverflowed
Indicates whether the tabs are overflowed.
IsTabContentHorizontal
Indicates whether the tab content layout is in a horizontal orientation.
IsTabKeyboardAccessEnabled
Indicates whether keyboard gestures to directly activate a tab are enabled.
public bool IsTabKeyboardAccessEnabled { get; set; }
Property Value
- bool:
The default value is
true.
Remarks
When enabled, Ctrl+1 will activate the first tab in a normal state, with Ctrl+2 activating the second normal tab, and so on.
Ctrl+Alt+1 will activate the first tab in a pinned state, with Ctrl+Alt+2 activating the second pinned tab, and so on.
IsTabKeyboardSwitchingEnabled
Indicates whether keyboard access to switch to the previous/next tab is enabled.
public bool IsTabKeyboardSwitchingEnabled { get; set; }
Property Value
- bool:
The default value is
true.
Remarks
When enabled, Ctrl+Tab will switch to the next tab and Ctrl+Shift+Tab will switch to the previous tab.
IsTabStripVisible
Indicates whether the tabstrip is visible.
MaxTabExtent
The maximum extent of a tab.
public double MaxTabExtent { get; set; }
Property Value
- double:
The default value is
260.0.
Remarks
Set the MinTabExtent to the same as the MaxTabExtent to produce fixed-size tabs.
MenuButtonContentTemplate
The DataTemplate to use for the drop-down menu button content.
MinTabExtent
The minimum extent of a tab.
public double MinTabExtent { get; set; }
Property Value
- double:
The default value is
30.0.
Remarks
Set the MinTabExtent to the same as the MaxTabExtent to produce fixed-size tabs. This property will be ignored when a TabOverflowBehavior that involves shrinking is active and the tabs enter an overflow scenario.
NewTabButtonStyle
The Style to use for the new tab button.
OverflowMenuButtonContentTemplate
The DataTemplate to use for the overflow drop-down menu button content.
RequestNewTabCommand
The ICommand that can be used to request a new tab.
RotatedBorderThickness
The BorderThickness value, but automatically rotated based on the TabStripPlacement.
public Thickness RotatedBorderThickness { get; set; }
Property Value
- Thickness:
The default value is
0.
Remarks
This property should not be set, as it will be set internally.
RotatedHighlightThickness
The HighlightThickness value, but automatically rotated based on the TabStripPlacement.
public Thickness RotatedHighlightThickness { get; set; }
Property Value
- Thickness:
The default value is
0.
Remarks
This property should not be set, as it will be set internally.
RotatedPadding
The Padding value, but automatically rotated based on the TabStripPlacement.
public Thickness RotatedPadding { get; set; }
Property Value
- Thickness:
The default value is
0.
Remarks
This property should not be set, as it will be set internally.
ScrollBackwardButtonContentTemplate
The DataTemplate to use for the scroll backward button content.
ScrollBackwardCommand
The ICommand that can be used to scroll backward.
ScrollForwardButtonContentTemplate
The DataTemplate to use for the scroll forward button content.
ScrollForwardCommand
The ICommand that can be used to scroll forward.
ScrollOffset
The scroll offset.
SelectItemCommand
The ICommand that can be used to select an item.
TabBackground
The tabs' background Brush to use.
TabBackgroundActiveSelected
The tabs' background Brush to use when the tab is selected and its content is active.
TabBackgroundInactiveSelected
The tabs' background Brush to use when the tab is selected and its content is inactive.
TabBackgroundPointerOver
The tabs' background Brush to use when the pointer is over it.
TabBackgroundPreview
The tabs' background Brush to use when the tab is a preview tab.
TabBackgroundPreviewActiveSelected
The tabs' background Brush to use when the tab is a preview tab, is selected, and its content is active.
TabBackgroundPreviewPointerOver
The tabs' border Brush to use when the tab is a preview tab and the pointer is over it.
TabBorderBrush
The tabs' border Brush to use.
TabBorderBrushActiveSelected
The tabs' border Brush to use when the tab is selected and its content is active.
TabBorderBrushInactiveSelected
The tabs' border Brush to use when the tab is selected and its content is inactive.
TabBorderBrushPointerOver
The tabs' border Brush to use when the pointer is over it.
TabBorderBrushPreview
The tabs' border Brush to use when the tab is a preview tab.
TabBorderBrushPreviewActiveSelected
The tabs' border Brush to use when the tab is a preview tab, is selected, and its content is active.
TabBorderBrushPreviewPointerOver
The tabs' border Brush to use when the tab is a preview tab and the pointer is over it.
TabCornerRadius
The corner radius of tab borders, relative to a top-facing tab.
TabEmbeddedButtonStyle
The Style to use for embedded buttons within tabs.
TabFarSlantExtent
The far side slant extent of the tabs, or 0.0 for no slant.
TabForeground
The tabs' foreground Brush to use.
TabForegroundActiveSelected
The tabs' foreground Brush to use when the tab is selected and its content is active.
TabForegroundInactiveSelected
The tabs' foreground Brush to use when the tab is selected and its content is inactive.
TabForegroundPointerOver
The tabs' foreground Brush to use when the pointer is over it.
TabForegroundPreview
The tabs' foreground Brush to use when the tab is a preview tab.
TabForegroundPreviewActiveSelected
The tabs' foreground Brush to use when the tab is a preview tab, is selected, and its content is active.
TabForegroundPreviewPointerOver
The tabs' foreground Brush to use when the tab is a preview tab and the pointer is over it.
TabNearSlantExtent
The near side slant extent of the tabs, or 0.0 for no slant.
TabOverflowBehavior
The TabOverflowBehavior that indicates the logic to use in tab overflow scenarios.
public TabOverflowBehavior TabOverflowBehavior { get; set; }
Property Value
- TabOverflowBehavior:
The default value is Shrink.
TabPadding
The tab padding.
TabSpacing
The spacing between tabs.
UseDefaultFocusHandling
Indicates whether to use default TabItem focus handling.
public bool UseDefaultFocusHandling { get; set; }
Property Value
- bool:
trueif defaultTabItemfocus handling should be used; otherwise,false. The default value istrue.
Methods
ActivateNextTab()
Activates the tab after the currently selected tab. If the currently selected tab is the last tab then the first tab will be activated next.
public bool ActivateNextTab()
Returns
- bool:
trueif activating the next tab was handled; otherwisefalse.
See Also
ActivatePreviousTab()
Activates the tab before the currently selected tab. If the currently selected tab is the first tab then the last tab will be activated next.
public bool ActivatePreviousTab()
Returns
- bool:
trueif activating the previous tab was handled; otherwisefalse.
See Also
ArrangeOverride(Size?)
Called to arrange and size the content of a Control object.
protected override Size? ArrangeOverride(Size? finalSize)
| Parameter | Type | Description |
|---|---|---|
| finalSize | Size |
Returns
- Size:
The size of the control.
ClearContainerForItemOverride(DependencyObject, object)
Returns an item container to the state it was in before PrepareContainerForItemOverride(DependencyObject, object).
protected override void ClearContainerForItemOverride(DependencyObject element, object item)
| Parameter | Type | Description |
|---|---|---|
| element | DependencyObject | The item container element. |
| item | object | The data item. |
GetContainerForItemOverride()
Creates or identifies the element used to display the specified item.
protected override DependencyObject GetContainerForItemOverride()
Returns
- DependencyObject:
The element used to display the specified item.
IsItemItsOwnContainerOverride(object)
Determines if the specified item is (or is eligible to be) its own ItemContainer.
protected override bool IsItemItsOwnContainerOverride(object item)
| Parameter | Type | Description |
|---|---|---|
| item | object | Specified item. |
Returns
- bool:
Returns
trueif the item is its ownItemContainer; otherwise,false.
OnApplyTemplate()
Called when ApplyTemplate() is called.
public override void OnApplyTemplate()
OnCreateAutomationPeer()
Provides an appropriate TabControlAutomationPeer implementation for this control, as part of the WPF automation infrastructure.
protected override AutomationPeer OnCreateAutomationPeer()
Returns
- AutomationPeer:
The type-specific AutomationPeer implementation.
OnKeyDown(KeyEventArgs)
Provides class handling for the KeyDown routed event that occurs when the user presses a key.
protected override void OnKeyDown(KeyEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | KeyEventArgs | Provides data for KeyEventArgs. |
OnRenderSizeChanged(SizeChangedInfo)
Raises the SizeChanged event, using the specified information as part of the eventual event data.
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)
| Parameter | Type | Description |
|---|---|---|
| sizeInfo | SizeChangedInfo | Details of the old and new size involved in the change. |
OnSelectionChanged(SelectionChangedEventArgs)
Raises the SelectionChanged routed event.
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
| Parameter | Type | Description |
|---|---|---|
| e | SelectionChangedEventArgs | Provides data for SelectionChangedEventArgs. |
PrepareContainerForItemOverride(DependencyObject, object)
Prepares the specified element to display the specified item.
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
| Parameter | Type | Description |
|---|---|---|
| element | DependencyObject | The element that is used to display the specified item. |
| item | object | The specified item to display. |
UpdateHighlightBrushes()
Optionally updates the HighlightBrushActive and HighlightBrushInactive properties based on the selected tab.
protected virtual void UpdateHighlightBrushes()
Remarks
The default implementation of this method does nothing.
Events
MenuOpening
Raised before a context or drop-down menu is opening.
public event EventHandler<AdvancedTabControlMenuEventArgs>? MenuOpening
Event Type
NewTabRequested
Raised when a new tab is requested.
TabClosing
Raised before a tab is closed due to clicking on its close button.
public event EventHandler<AdvancedTabItemEventArgs>? TabClosing
Event Type
TabDragReordered
Raised when a tab is reordered using internal drag/drop.
public event EventHandler<AdvancedTabItemEventArgs>? TabDragReordered
Event Type
Fields
AreScrollButtonsVisibleProperty
Defines the AreScrollButtonsVisible property.
public static readonly DependencyProperty AreScrollButtonsVisibleProperty
AreTabEmbeddedButtonsAlwaysVisibleProperty
Defines the AreTabEmbeddedButtonsAlwaysVisible property.
public static readonly DependencyProperty AreTabEmbeddedButtonsAlwaysVisibleProperty
CanScrollBackwardProperty
Defines the CanScrollBackward property.
public static readonly DependencyProperty CanScrollBackwardProperty
CanScrollForwardProperty
Defines the CanScrollForward property.
public static readonly DependencyProperty CanScrollForwardProperty
CanTabsCloseOnMiddleClickProperty
Defines the CanTabsCloseOnMiddleClick property.
public static readonly DependencyProperty CanTabsCloseOnMiddleClickProperty
CanTabsDragProperty
Defines the CanTabsDrag property.
public static readonly DependencyProperty CanTabsDragProperty
CanTabsHighlightOnPointerOverWhenInactiveProperty
Defines the CanTabsHighlightOnPointerOverWhenInactive property.
public static readonly DependencyProperty CanTabsHighlightOnPointerOverWhenInactiveProperty
CanTabsPinProperty
Defines the CanTabsPin property.
public static readonly DependencyProperty CanTabsPinProperty
CanTabsPromoteProperty
Defines the CanTabsPromote property.
public static readonly DependencyProperty CanTabsPromoteProperty
CanTabsSelectOnDragOverProperty
Defines the CanTabsSelectOnDragOver property.
public static readonly DependencyProperty CanTabsSelectOnDragOverProperty
EmbeddedButtonStyleProperty
Defines the EmbeddedButtonStyle property.
public static readonly DependencyProperty EmbeddedButtonStyleProperty
HasNewTabButtonProperty
Defines the HasNewTabButton property.
public static readonly DependencyProperty HasNewTabButtonProperty
HasTabCloseButtonsProperty
Defines the HasTabCloseButtons property.
public static readonly DependencyProperty HasTabCloseButtonsProperty
HasTabImagesProperty
Defines the HasTabImages property.
public static readonly DependencyProperty HasTabImagesProperty
HeaderBackgroundProperty
Defines the HeaderBackground property.
public static readonly DependencyProperty HeaderBackgroundProperty
HighlightBrushActiveProperty
Defines the HighlightBrushActive property.
public static readonly DependencyProperty HighlightBrushActiveProperty
HighlightBrushInactiveProperty
Defines the HighlightBrushInactive property.
public static readonly DependencyProperty HighlightBrushInactiveProperty
HighlightThicknessProperty
Defines the HighlightThickness property.
public static readonly DependencyProperty HighlightThicknessProperty
IsActiveProperty
Defines the IsActive property.
public static readonly DependencyProperty IsActiveProperty
IsLayoutAnimationEnabledProperty
Defines the IsLayoutAnimationEnabled property.
public static readonly DependencyProperty IsLayoutAnimationEnabledProperty
IsMenuButtonVisibleProperty
Defines the IsMenuButtonVisible property.
public static readonly DependencyProperty IsMenuButtonVisibleProperty
IsOverflowedProperty
Defines the IsOverflowed property.
public static readonly DependencyProperty IsOverflowedProperty
IsTabContentHorizontalProperty
Defines the IsTabContentHorizontal property.
public static readonly DependencyProperty IsTabContentHorizontalProperty
IsTabKeyboardAccessEnabledProperty
Defines the IsTabKeyboardAccessEnabled property.
public static readonly DependencyProperty IsTabKeyboardAccessEnabledProperty
IsTabKeyboardSwitchingEnabledProperty
Defines the IsTabKeyboardSwitchingEnabled property.
public static readonly DependencyProperty IsTabKeyboardSwitchingEnabledProperty
IsTabStripVisibleProperty
Defines the IsTabStripVisible property.
public static readonly DependencyProperty IsTabStripVisibleProperty
MaxTabExtentProperty
Defines the MaxTabExtent property.
public static readonly DependencyProperty MaxTabExtentProperty
MenuButtonContentTemplateProperty
Defines the MenuButtonContentTemplate property.
public static readonly DependencyProperty MenuButtonContentTemplateProperty
MinTabExtentProperty
Defines the MinTabExtent property.
public static readonly DependencyProperty MinTabExtentProperty
NewTabButtonStyleProperty
Defines the NewTabButtonStyle property.
public static readonly DependencyProperty NewTabButtonStyleProperty
OverflowMenuButtonContentTemplateProperty
Defines the OverflowMenuButtonContentTemplate property.
public static readonly DependencyProperty OverflowMenuButtonContentTemplateProperty
RotatedBorderThicknessProperty
Defines the RotatedBorderThickness property.
public static readonly DependencyProperty RotatedBorderThicknessProperty
RotatedHighlightThicknessProperty
Defines the RotatedHighlightThickness property.
public static readonly DependencyProperty RotatedHighlightThicknessProperty
RotatedPaddingProperty
Defines the RotatedPadding property.
public static readonly DependencyProperty RotatedPaddingProperty
ScrollBackwardButtonContentTemplateProperty
Defines the ScrollBackwardButtonContentTemplate property.
public static readonly DependencyProperty ScrollBackwardButtonContentTemplateProperty
ScrollForwardButtonContentTemplateProperty
Defines the ScrollForwardButtonContentTemplate property.
public static readonly DependencyProperty ScrollForwardButtonContentTemplateProperty
ScrollOffsetProperty
Defines the ScrollOffset property.
public static readonly DependencyProperty ScrollOffsetProperty
TabBackgroundActiveSelectedProperty
Defines the TabBackgroundActiveSelected property.
public static readonly DependencyProperty TabBackgroundActiveSelectedProperty
TabBackgroundInactiveSelectedProperty
Defines the TabBackgroundInactiveSelected property.
public static readonly DependencyProperty TabBackgroundInactiveSelectedProperty
TabBackgroundPointerOverProperty
Defines the TabBackgroundPointerOver property.
public static readonly DependencyProperty TabBackgroundPointerOverProperty
TabBackgroundPreviewActiveSelectedProperty
Defines the TabBackgroundPreviewActiveSelected property.
public static readonly DependencyProperty TabBackgroundPreviewActiveSelectedProperty
TabBackgroundPreviewPointerOverProperty
Defines the TabBackgroundPreviewPointerOver property.
public static readonly DependencyProperty TabBackgroundPreviewPointerOverProperty
TabBackgroundPreviewProperty
Defines the TabBackgroundPreview property.
public static readonly DependencyProperty TabBackgroundPreviewProperty
TabBackgroundProperty
Defines the TabBackground property.
public static readonly DependencyProperty TabBackgroundProperty
TabBorderBrushActiveSelectedProperty
Defines the TabBorderBrushActiveSelected property.
public static readonly DependencyProperty TabBorderBrushActiveSelectedProperty
TabBorderBrushInactiveSelectedProperty
Defines the TabBorderBrushInactiveSelected property.
public static readonly DependencyProperty TabBorderBrushInactiveSelectedProperty
TabBorderBrushPointerOverProperty
Defines the TabBorderBrushPointerOver property.
public static readonly DependencyProperty TabBorderBrushPointerOverProperty
TabBorderBrushPreviewActiveSelectedProperty
Defines the TabBorderBrushPreviewActiveSelected property.
public static readonly DependencyProperty TabBorderBrushPreviewActiveSelectedProperty
TabBorderBrushPreviewPointerOverProperty
Defines the TabBorderBrushPreviewPointerOver property.
public static readonly DependencyProperty TabBorderBrushPreviewPointerOverProperty
TabBorderBrushPreviewProperty
Defines the TabBorderBrushPreview property.
public static readonly DependencyProperty TabBorderBrushPreviewProperty
TabBorderBrushProperty
Defines the TabBorderBrush property.
public static readonly DependencyProperty TabBorderBrushProperty
TabCornerRadiusProperty
Defines the TabCornerRadius property.
public static readonly DependencyProperty TabCornerRadiusProperty
TabEmbeddedButtonStyleProperty
Defines the TabEmbeddedButtonStyle property.
public static readonly DependencyProperty TabEmbeddedButtonStyleProperty
TabFarSlantExtentProperty
Defines the TabFarSlantExtent property.
public static readonly DependencyProperty TabFarSlantExtentProperty
TabForegroundActiveSelectedProperty
Defines the TabForegroundActiveSelected property.
public static readonly DependencyProperty TabForegroundActiveSelectedProperty
TabForegroundInactiveSelectedProperty
Defines the TabForegroundInactiveSelected property.
public static readonly DependencyProperty TabForegroundInactiveSelectedProperty
TabForegroundPointerOverProperty
Defines the TabForegroundPointerOver property.
public static readonly DependencyProperty TabForegroundPointerOverProperty
TabForegroundPreviewActiveSelectedProperty
Defines the TabForegroundPreviewActiveSelected property.
public static readonly DependencyProperty TabForegroundPreviewActiveSelectedProperty
TabForegroundPreviewPointerOverProperty
Defines the TabForegroundPreviewPointerOver property.
public static readonly DependencyProperty TabForegroundPreviewPointerOverProperty
TabForegroundPreviewProperty
Defines the TabForegroundPreview property.
public static readonly DependencyProperty TabForegroundPreviewProperty
TabForegroundProperty
Defines the TabForeground property.
public static readonly DependencyProperty TabForegroundProperty
TabNearSlantExtentProperty
Defines the TabNearSlantExtent property.
public static readonly DependencyProperty TabNearSlantExtentProperty
TabOverflowBehaviorProperty
Defines the TabOverflowBehavior property.
public static readonly DependencyProperty TabOverflowBehaviorProperty
TabPaddingProperty
Defines the TabPadding property.
public static readonly DependencyProperty TabPaddingProperty
TabSpacingProperty
Defines the TabSpacing property.
public static readonly DependencyProperty TabSpacingProperty
UseDefaultFocusHandlingProperty
Defines the UseDefaultFocusHandling property.
public static readonly DependencyProperty UseDefaultFocusHandlingProperty