In This Article

AdvancedTabItem Class

Represents a tab item for use in an AdvancedTabControl.

[TemplateVisualState(Name = "None", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "PointerOver", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "ActiveSelected", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "InactiveSelected", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "Preview", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "PreviewActiveSelected", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "PreviewPointerOver", GroupName = "HighlightStates")]
[TemplateVisualState(Name = "NormalLayout", GroupName = "LayoutKindStates")]
[TemplateVisualState(Name = "PinnedLayout", GroupName = "LayoutKindStates")]
[TemplateVisualState(Name = "PreviewLayout", GroupName = "LayoutKindStates")]
[TemplateVisualState(Name = "Editable", GroupName = "ReadOnlyStates")]
[TemplateVisualState(Name = "ReadOnly", GroupName = "ReadOnlyStates")]
public class AdvancedTabItem : TabItem
Inheritance:
object Visual UIElement FrameworkElement Control ContentControl HeaderedContentControl TabItem object
Derived:
DockingWindowContainerTabItem

Constructors

AdvancedTabItem()

Initializes an instance of the class.

public AdvancedTabItem()

Properties

AreEmbeddedButtonsAlwaysVisible

Indicates whether embedded buttons are always visible, even when the tab is unselected.

public bool AreEmbeddedButtonsAlwaysVisible { get; set; }

Property Value

bool:

The default value is false.

ArrangeHeightAnimated

The arrange height of the tab. This property is for internal use only.

public double ArrangeHeightAnimated { get; set; }

Property Value

double

ArrangeWidthAnimated

The arrange width of the tab. This property is for internal use only.

public double ArrangeWidthAnimated { get; set; }

Property Value

double

ArrangeXAnimated

The arrange x-coordinate of the tab. This property is for internal use only.

public double ArrangeXAnimated { get; set; }

Property Value

double

ArrangeYAnimated

The arrange y-coordinate of the tab. This property is for internal use only.

public double ArrangeYAnimated { get; set; }

Property Value

double

BackgroundActiveSelected

The control's background Brush to use when the tab is selected and its content is active.

public Brush? BackgroundActiveSelected { get; set; }

Property Value

Brush

BackgroundInactiveSelected

The control's background Brush to use when the tab is selected and its content is inactive.

public Brush? BackgroundInactiveSelected { get; set; }

Property Value

Brush

BackgroundPointerOver

The control's background Brush to use when the pointer is over it.

public Brush? BackgroundPointerOver { get; set; }

Property Value

Brush

BackgroundPreview

The control's background Brush to use when the tab is a preview tab.

public Brush? BackgroundPreview { get; set; }

Property Value

Brush

BackgroundPreviewActiveSelected

The control's background Brush to use when the tab is a preview tab, is selected, and its content is active.

public Brush? BackgroundPreviewActiveSelected { get; set; }

Property Value

Brush

BackgroundPreviewPointerOver

The control's border Brush to use when the tab is a preview tab and the pointer is over it.

public Brush? BackgroundPreviewPointerOver { get; set; }

Property Value

Brush

BorderBrushActiveSelected

The control's border Brush to use when the tab is selected and its content is active.

public Brush? BorderBrushActiveSelected { get; set; }

Property Value

Brush

BorderBrushInactiveSelected

The control's border Brush to use when the tab is selected and its content is inactive.

public Brush? BorderBrushInactiveSelected { get; set; }

Property Value

Brush

BorderBrushPointerOver

The control's border Brush to use when the pointer is over it.

public Brush? BorderBrushPointerOver { get; set; }

Property Value

Brush

BorderBrushPreview

The control's border Brush to use when the tab is a preview tab.

public Brush? BorderBrushPreview { get; set; }

Property Value

Brush

BorderBrushPreviewActiveSelected

The control's border Brush to use when the tab is a preview tab, is selected, and its content is active.

public Brush? BorderBrushPreviewActiveSelected { get; set; }

Property Value

Brush

BorderBrushPreviewPointerOver

The control's border Brush to use when the tab is a preview tab and the pointer is over it.

public Brush? BorderBrushPreviewPointerOver { get; set; }

Property Value

Brush

CanClose

Indicates whether the tab displays an embedded close button.

public bool CanClose { get; set; }

Property Value

bool:

The default value is true.

CanHighlightOnPointerOverWhenInactive

Indicates whether the tab can highlight when the pointer is over it and it is inactive.

public bool CanHighlightOnPointerOverWhenInactive { get; set; }

Property Value

bool:

The default value is false.

CanPin

Indicates whether the tab displays an embedded pin button.

public bool CanPin { get; set; }

Property Value

bool:

The default value is false.

CanPromote

Indicates whether the tab displays an embedded promote from preview layout kind button.

public bool CanPromote { get; set; }

Property Value

bool:

The default value is true.

CloseButtonContentTemplate

The DataTemplate to use for the close button content.

public DataTemplate? CloseButtonContentTemplate { get; set; }

Property Value

DataTemplate

CloseCommand

The ICommand that can be used to close the tab.

public ICommand CloseCommand { get; }

Property Value

ICommand

ContextContent

The contextual content to display.

public object? ContextContent { get; }

Property Value

object

ContextContentTemplate

The DataTemplate to use for displaying contextual content.

public DataTemplate? ContextContentTemplate { get; set; }

Property Value

DataTemplate

CornerRadius

The corner radius of the tab border, relative to a top-facing tab.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

EmbeddedButtonStyle

The Style to use for embedded buttons.

public Style? EmbeddedButtonStyle { get; set; }

Property Value

Style

FarSlantExtent

The far side slant extent of the tab, or 0.0 for no slant.

public double FarSlantExtent { get; set; }

Property Value

double:

The default value is 0.0.

FlashColor

The flash color to use if flashing is enabled.

public Color FlashColor { get; set; }

Property Value

Color:

The default value is #80FFA000.

FlashMode

The flash mode for the tab.

public TabFlashMode FlashMode { get; set; }

Property Value

TabFlashMode

ForegroundActiveSelected

The control's foreground Brush to use when the tab is selected and its content is active.

public Brush? ForegroundActiveSelected { get; set; }

Property Value

Brush

ForegroundInactiveSelected

The control's foreground Brush to use when the tab is selected and its content is inactive.

public Brush? ForegroundInactiveSelected { get; set; }

Property Value

Brush

ForegroundPointerOver

The control's foreground Brush to use when the pointer is over it.

public Brush? ForegroundPointerOver { get; set; }

Property Value

Brush

ForegroundPreview

The control's foreground Brush to use when the tab is a preview tab.

public Brush? ForegroundPreview { get; set; }

Property Value

Brush

ForegroundPreviewActiveSelected

The control's foreground Brush to use when the tab is a preview tab, is selected, and its content is active.

public Brush? ForegroundPreviewActiveSelected { get; set; }

Property Value

Brush

ForegroundPreviewPointerOver

The control's foreground Brush to use when the tab is a preview tab and the pointer is over it.

public Brush? ForegroundPreviewPointerOver { get; set; }

Property Value

Brush

HasCloseButton

Indicates whether the tab has an embedded close button based on its current state.

public bool HasCloseButton { get; }

Property Value

bool:

The default value is false.

Remarks

When this property is true, space is reserved in the tab for the close button. The actual visibility of the close button depends on the IsCloseButtonVisible property.

HasToggleLayoutKindButton

Indicates whether the tab has an embedded toggle layout kind button based on its current state.

public bool HasToggleLayoutKindButton { get; }

Property Value

bool:

The default value is false.

Remarks

When this property is true, space is reserved in the tab for the toggle layout kind button. The actual visibility of the toggle layout kind button depends on the IsToggleLayoutKindButtonVisible property.

HighlightKind

The TabHighlightKind indicating the kind of highlight to apply to the tab.

public TabHighlightKind HighlightKind { get; }

Property Value

TabHighlightKind:

The default value is None.

ImageSource

A ImageSource for an image that renders on the tab.

public ImageSource? ImageSource { get; set; }

Property Value

ImageSource

IsCloseButtonVisible

Indicates whether the embedded close button is visible.

public bool IsCloseButtonVisible { get; }

Property Value

bool:

The default value is false.

IsContentHorizontal

Indicates whether the content layout is in a horizontal orientation.

public bool IsContentHorizontal { get; set; }

Property Value

bool:

The default value is true.

IsImageVisible

Indicates whether the embedded image is visible.

public bool IsImageVisible { get; }

Property Value

bool:

The default value is false.

IsLoadAnimationEnabled

Indicates whether animation effects may be applied when the tab is loaded.

public bool IsLoadAnimationEnabled { get; set; }

Property Value

bool:

The default value is false.

IsReadOnly

Indicates whether the tab's contents are read-only.

public bool IsReadOnly { get; set; }

Property Value

bool:

The default value is false.

IsToggleLayoutKindButtonVisible

Indicates whether the embedded toggle layout kind button is visible.

public bool IsToggleLayoutKindButtonVisible { get; }

Property Value

bool:

The default value is false.

LayoutKind

The TabLayoutKind that indicates how the tab will be positioned.

public TabLayoutKind LayoutKind { get; set; }

Property Value

TabLayoutKind:

The default value is Normal.

NearSlantExtent

The near side slant extent of the tab, or 0.0 for no slant.

public double NearSlantExtent { get; set; }

Property Value

double:

The default value is 0.0.

PinButtonContentTemplate

The DataTemplate to use for the pin button content.

public DataTemplate? PinButtonContentTemplate { get; set; }

Property Value

DataTemplate

PromoteButtonContentTemplate

The DataTemplate to use for the promote button content.

public DataTemplate? PromoteButtonContentTemplate { get; set; }

Property Value

DataTemplate

ReadOnlyContextContentTemplate

The DataTemplate to assign to ContextContentTemplate when the IsReadOnly property is true.

public DataTemplate? ReadOnlyContextContentTemplate { get; set; }

Property Value

DataTemplate

TintColor

The tint color applied to the Background and BorderBrush brushes.

public Color TintColor { get; set; }

Property Value

Color:

The default value is Transparent, which indicates no tinting should be applied.

ToggleLayoutKindCommand

The ICommand that can be used to toggle the tab's layout kind.

public ICommand ToggleLayoutKindCommand { get; }

Property Value

ICommand

UnpinButtonContentTemplate

The DataTemplate to use for the unpin button content.

public DataTemplate? UnpinButtonContentTemplate { get; set; }

Property Value

DataTemplate

Methods

Activate()

Activates the tab by selecting it (if unselected), ensuring that it is visible, and focusing the content within it.

public void Activate()

Close()

Closes the tab, removing it from the containing tab control.

public void Close()

DragMove(InputPointerButtonEventArgs)

Starts a drag/move.

public void DragMove(InputPointerButtonEventArgs sourceEventArgs)
Parameter Type Description
sourceEventArgs InputPointerButtonEventArgs

The source InputPointerButtonEventArgs, which can be used to capture the pointer.

Remarks

The primary button of the pointer in the event arguments must be pressed down when calling this method. The pointer will be captured.

OnApplyTemplate()

When overridden in a derived class, is invoked whenever application code or internal processes call ApplyTemplate().

public override void OnApplyTemplate()

OnContextMenuOpening(ContextMenuEventArgs)

Invoked whenever an unhandled ContextMenuOpening routed event reaches this class in its route. Implement this method to add class handling for this event.

protected override void OnContextMenuOpening(ContextMenuEventArgs e)
Parameter Type Description
e ContextMenuEventArgs

The RoutedEventArgs that contains the event data.

OnCreateAutomationPeer()

Provides an appropriate TabItemAutomationPeer implementation for this control, as part of the WPF automation infrastructure.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer:

The type-specific AutomationPeer implementation.

OnDragEnter(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnDragEnter(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnDragOver(DragEventArgs)

Invoked when an unhandled System.Windows.DragDrop.DragOver attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.

protected override void OnDragOver(DragEventArgs e)
Parameter Type Description
e DragEventArgs

The DragEventArgs that contains the event data.

OnMouseLeftButtonDown(MouseButtonEventArgs)

Responds to the MouseLeftButtonDown event.

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

Provides data for MouseButtonEventArgs.

OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs)

Announces that the keyboard is focused on this element.

protected override void OnPreviewGotKeyboardFocus(KeyboardFocusChangedEventArgs e)
Parameter Type Description
e KeyboardFocusChangedEventArgs

Keyboard input event arguments.

OnSelected(RoutedEventArgs)

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

protected override void OnSelected(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The event data for the System.Windows.Controls.Primitives.Selector.Selected event.

OnUnselected(RoutedEventArgs)

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

protected override void OnUnselected(RoutedEventArgs e)
Parameter Type Description
e RoutedEventArgs

The event data for the System.Windows.Controls.Primitives.Selector.Unselected event.

ToggleLayoutKind()

Toggles the tab's LayoutKind.

public void ToggleLayoutKind()

Remarks

Normal tabs will switch to Pinned layout. All other layout kinds switch back to Normal.

Fields

AreEmbeddedButtonsAlwaysVisibleProperty

Defines the AreEmbeddedButtonsAlwaysVisible property.

public static readonly DependencyProperty AreEmbeddedButtonsAlwaysVisibleProperty

ArrangeHeightAnimatedProperty

Defines the ArrangeHeightAnimated property.

public static readonly DependencyProperty ArrangeHeightAnimatedProperty

ArrangeWidthAnimatedProperty

Defines the ArrangeWidthAnimated property.

public static readonly DependencyProperty ArrangeWidthAnimatedProperty

ArrangeXAnimatedProperty

Defines the ArrangeXAnimated property.

public static readonly DependencyProperty ArrangeXAnimatedProperty

ArrangeYAnimatedProperty

Defines the ArrangeYAnimated property.

public static readonly DependencyProperty ArrangeYAnimatedProperty

BackgroundActiveSelectedProperty

Defines the BackgroundActiveSelected property.

public static readonly DependencyProperty BackgroundActiveSelectedProperty

BackgroundInactiveSelectedProperty

Defines the BackgroundInactiveSelected property.

public static readonly DependencyProperty BackgroundInactiveSelectedProperty

BackgroundPointerOverProperty

Defines the BackgroundPointerOver property.

public static readonly DependencyProperty BackgroundPointerOverProperty

BackgroundPreviewActiveSelectedProperty

Defines the BackgroundPreviewActiveSelected property.

public static readonly DependencyProperty BackgroundPreviewActiveSelectedProperty

BackgroundPreviewPointerOverProperty

Defines the BackgroundPreviewPointerOver property.

public static readonly DependencyProperty BackgroundPreviewPointerOverProperty

BackgroundPreviewProperty

Defines the BackgroundPreview property.

public static readonly DependencyProperty BackgroundPreviewProperty

BorderBrushActiveSelectedProperty

Defines the BorderBrushActiveSelected property.

public static readonly DependencyProperty BorderBrushActiveSelectedProperty

BorderBrushInactiveSelectedProperty

Defines the BorderBrushInactiveSelected property.

public static readonly DependencyProperty BorderBrushInactiveSelectedProperty

BorderBrushPointerOverProperty

Defines the BorderBrushPointerOver property.

public static readonly DependencyProperty BorderBrushPointerOverProperty

BorderBrushPreviewActiveSelectedProperty

Defines the BorderBrushPreviewActiveSelected property.

public static readonly DependencyProperty BorderBrushPreviewActiveSelectedProperty

BorderBrushPreviewPointerOverProperty

Defines the BorderBrushPreviewPointerOver property.

public static readonly DependencyProperty BorderBrushPreviewPointerOverProperty

BorderBrushPreviewProperty

Defines the BorderBrushPreview property.

public static readonly DependencyProperty BorderBrushPreviewProperty

CanCloseProperty

Defines the CanClose property.

public static readonly DependencyProperty CanCloseProperty

CanHighlightOnPointerOverWhenInactiveProperty

public static readonly DependencyProperty CanHighlightOnPointerOverWhenInactiveProperty

CanPinProperty

Defines the CanPin property.

public static readonly DependencyProperty CanPinProperty

CanPromoteProperty

Defines the CanPromote property.

public static readonly DependencyProperty CanPromoteProperty

CloseButtonContentTemplateProperty

Defines the CloseButtonContentTemplate property.

public static readonly DependencyProperty CloseButtonContentTemplateProperty

ContextContentProperty

Defines the ContextContent property.

public static readonly DependencyProperty ContextContentProperty

ContextContentTemplateProperty

Defines the ContextContentTemplate property.

public static readonly DependencyProperty ContextContentTemplateProperty

CornerRadiusProperty

Defines the CornerRadius property.

public static readonly DependencyProperty CornerRadiusProperty

EmbeddedButtonStyleProperty

Defines the EmbeddedButtonStyle property.

public static readonly DependencyProperty EmbeddedButtonStyleProperty

FarSlantExtentProperty

Defines the FarSlantExtent property.

public static readonly DependencyProperty FarSlantExtentProperty

FlashColorProperty

Defines the FlashColor property.

public static readonly DependencyProperty FlashColorProperty

FlashModeProperty

Defines the FlashMode property.

public static readonly DependencyProperty FlashModeProperty

ForegroundActiveSelectedProperty

Defines the ForegroundActiveSelected property.

public static readonly DependencyProperty ForegroundActiveSelectedProperty

ForegroundInactiveSelectedProperty

Defines the ForegroundInactiveSelected property.

public static readonly DependencyProperty ForegroundInactiveSelectedProperty

ForegroundPointerOverProperty

Defines the ForegroundPointerOver property.

public static readonly DependencyProperty ForegroundPointerOverProperty

ForegroundPreviewActiveSelectedProperty

Defines the ForegroundPreviewActiveSelected property.

public static readonly DependencyProperty ForegroundPreviewActiveSelectedProperty

ForegroundPreviewPointerOverProperty

Defines the ForegroundPreviewPointerOver property.

public static readonly DependencyProperty ForegroundPreviewPointerOverProperty

ForegroundPreviewProperty

Defines the ForegroundPreview property.

public static readonly DependencyProperty ForegroundPreviewProperty

HasCloseButtonProperty

Defines the HasCloseButton property.

public static readonly DependencyProperty HasCloseButtonProperty

HasToggleLayoutKindButtonProperty

Defines the HasToggleLayoutKindButton property.

public static readonly DependencyProperty HasToggleLayoutKindButtonProperty

HighlightKindProperty

Defines the HighlightKind property.

public static readonly DependencyProperty HighlightKindProperty

ImageSourceProperty

Defines the ImageSource property.

public static readonly DependencyProperty ImageSourceProperty

IsCloseButtonVisibleProperty

Defines the IsCloseButtonVisible property.

public static readonly DependencyProperty IsCloseButtonVisibleProperty

IsContentHorizontalProperty

Defines the IsContentHorizontal property.

public static readonly DependencyProperty IsContentHorizontalProperty

IsImageVisibleProperty

Defines the IsImageVisible property.

public static readonly DependencyProperty IsImageVisibleProperty

IsLoadAnimationEnabledProperty

Defines the IsLoadAnimationEnabled property.

public static readonly DependencyProperty IsLoadAnimationEnabledProperty

IsReadOnlyProperty

Defines the IsReadOnly property.

public static readonly DependencyProperty IsReadOnlyProperty

IsToggleLayoutKindButtonVisibleProperty

Defines the IsToggleLayoutKindButtonVisible property.

public static readonly DependencyProperty IsToggleLayoutKindButtonVisibleProperty

LayoutKindProperty

Defines the LayoutKind property.

public static readonly DependencyProperty LayoutKindProperty

NearSlantExtentProperty

Defines the NearSlantExtent property.

public static readonly DependencyProperty NearSlantExtentProperty

PinButtonContentTemplateProperty

Defines the PinButtonContentTemplate property.

public static readonly DependencyProperty PinButtonContentTemplateProperty

PromoteButtonContentTemplateProperty

Defines the PromoteButtonContentTemplate property.

public static readonly DependencyProperty PromoteButtonContentTemplateProperty

ReadOnlyContextContentTemplateProperty

Defines the ReadOnlyContextContentTemplate property.

public static readonly DependencyProperty ReadOnlyContextContentTemplateProperty

TintColorProperty

Defines the TintColor property.

public static readonly DependencyProperty TintColorProperty

UnpinButtonContentTemplateProperty

Defines the UnpinButtonContentTemplate property.

public static readonly DependencyProperty UnpinButtonContentTemplateProperty

Extension Methods