TabView
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf.Controls
public class TabView : TabControl
A TabControl aligned with the WinUI 3 TabView: per-tab close buttons, a trailing "add" (+) button, horizontally scrollable tab strip with scroll navigation buttons, and WinUI-styled selection indicator.
Remarks: TabView produces TabViewItem containers by default. Consumers can bind to ItemsSource and optionally supply an ItemTemplate to render header content for each item; the icon and close-button chrome are always supplied by the container template.
Listen to AddTabButtonClick to create new tabs and to TabCloseRequested to remove a tab; this control does not itself mutate the items collection so applications remain in full control of their data model.
PART_ScrollBackButton and PART_ScrollForwardButton are automatically shown or hidden based on whether the tab strip overflows the available width.
Base type: TabControl (including inherited WPF and .NET members)
Constructors
TabView
public TabView()
Initializes a new instance of the TabView class and subscribes to child CloseRequested events for aggregation.
Properties
CloseButtonOverlayMode
public TabViewCloseButtonOverlayMode CloseButtonOverlayMode { get; set; }
Gets or sets when per-tab close buttons are shown on this control's items.
IsAddTabButtonVisible
public bool IsAddTabButtonVisible { get; set; }
Gets or sets whether the trailing add-tab (+) button is shown.
TabWidthMode
public TabViewWidthMode TabWidthMode { get; set; }
Gets or sets how tab widths are distributed in the tab strip.
Methods
GetContainerForItemOverride
protected override DependencyObject GetContainerForItemOverride()
Documentation inherited from the TabControl API.
IsItemItsOwnContainerOverride
protected override bool IsItemItsOwnContainerOverride(object item)
Documentation inherited from the TabControl API.
OnApplyTemplate
public override void OnApplyTemplate()
Documentation inherited from the TabControl API.
OnItemsChanged
protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
Documentation inherited from the TabControl API.
OnSelectionChanged
protected override void OnSelectionChanged(SelectionChangedEventArgs e)
Documentation inherited from the TabControl API.
PrepareContainerForItemOverride
protected override void PrepareContainerForItemOverride(DependencyObject element, object item)
Documentation inherited from the TabControl API.
Events
AddTabButtonClick
public event RoutedEventHandler AddTabButtonClick
Raised when the user clicks the add-tab (+) button. Consumers typically insert a new item into their items collection and optionally select it.
TabCloseRequested
public event EventHandler<TabViewTabCloseRequestedEventArgs> TabCloseRequested
Raised when the user clicks the close (×) button of a TabViewItem. The event args include the container and the bound item; consumers decide whether to remove it.
Dependency property identifiers
Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.
CloseButtonOverlayModeProperty
public static readonly DependencyProperty CloseButtonOverlayModeProperty
Identifies the CloseButtonOverlayMode dependency property.
IsAddTabButtonVisibleProperty
public static readonly DependencyProperty IsAddTabButtonVisibleProperty
Identifies the IsAddTabButtonVisible dependency property.
TabWidthModeProperty
public static readonly DependencyProperty TabWidthModeProperty
Identifies the TabWidthMode dependency property.
Fields
AddTabButtonClickEvent
public static readonly RoutedEvent AddTabButtonClickEvent
Identifies the AddTabButtonClick routed event.
TabCloseRequestedEvent
public static readonly RoutedEvent TabCloseRequestedEvent
Identifies the TabCloseRequested routed event.