New to Telerik UI for WPFStart a free 30-day trial

Represents a base class for creating tabbed interfaces in WPF applications. The RadTabControlBase class provides comprehensive functionality for managing tab items, handling selection changes, and visually representing tabs along with their associated content. This class supports dependency properties that allow for customization of appearance, behavior, and content representation of tabs. It also encapsulates event handling for selection change notifications, dropdown events, and tab row reordering, enabling developers to create intuitive user interfaces that follow common tab navigation patterns. Additionally, this class includes methods for focus management and content preservation during tab selection changes, ensuring a smooth user experience.

Definition

Namespace:Telerik.Windows.Controls.TabControl

Assembly:Telerik.Windows.Controls.Navigation.dll

Syntax:

C#
public abstract class RadTabControlBase : MultiSelector

Inheritance: objectRadTabControlBase

Derived Classes: RadDiagramToolboxRadRibbonViewRadTabControl

Constructors

Initializes a new instance of the RadTabControlBase class.

C#
protected RadTabControlBase()

Fields

Identifies the BackgroundVisibility property.

C#
public static readonly DependencyProperty BackgroundVisibilityProperty

ContentTemplateProperty

DependencyProperty

Identifies the ContentTemplate property.

C#
public static readonly DependencyProperty ContentTemplateProperty

Identifies the ContentTemplateSelector property.

C#
public static readonly DependencyProperty ContentTemplateSelectorProperty

Identifies the DropDownClosed routed event.

C#
public static readonly RoutedEvent DropDownClosedEvent

Identifies the DropDownOpened routed event.

C#
public static readonly RoutedEvent DropDownOpenedEvent

HeaderBackgroundProperty

DependencyProperty

Identifies the HeaderBackground property.

C#
public static readonly DependencyProperty HeaderBackgroundProperty

IsContentPreservedProperty

DependencyProperty

Identifies the IsContentPreserved property.

C#
public static readonly DependencyProperty IsContentPreservedProperty

Identifies the PreviewSelectionChanged routed event.

C#
public static readonly RoutedEvent PreviewSelectionChangedEvent

Identifies the PropagateItemDataContextToContent property.

C#
public static readonly DependencyProperty PropagateItemDataContextToContentProperty

ReorderTabRowsProperty

DependencyProperty

Identifies the ReorderTabRows property.

C#
public static readonly DependencyProperty ReorderTabRowsProperty

SelectedContentProperty

DependencyProperty

Identifies the SelectedContent property.

C#
public static readonly DependencyProperty SelectedContentProperty

Identifies the SelectedContentTemplate property.

C#
public static readonly DependencyProperty SelectedContentTemplateProperty

Identifies the SelectedContentTemplateSelector property.

C#
public static readonly DependencyProperty SelectedContentTemplateSelectorProperty

Identifies the SelectedItemRemoveBehaviour property.

C#
public static readonly DependencyProperty SelectedItemRemoveBehaviourProperty

Identifies the SelectionChanged routed event.

C#
public static readonly RoutedEvent SelectionChangedEvent

Properties

Gets or sets the visibility of the background panel for the headers in the tab control. This is a dependency property.

C#
[SRCategory("AppearanceCategory")]
[SRDescription("TabControlBackgroundOpacityDescription")]
public virtual Visibility BackgroundVisibility { get; set; }
Remarks:

This property gives you a quick way to change the visibility of the background without having to modify the ControlTemplate of the TabControl.

This property does not affect the visibility of the divider (the line between the items and the content). To change the divider, edit the appropriate control template.

The default value is Visible.

ContentElement

ContentPresenter

The ContentElement template part.

C#
protected ContentPresenter ContentElement { get; set; }
Property Value:

The content element.

The ContentElementsPanel template part.

C#
protected Grid ContentElementsPanel { get; set; }
Property Value:

The content element.

ContentTemplate

DataTemplate

Gets or sets the DataTemplate that will be used as a content template for all items that do not have a ContentTemplate. This is a dependency property.

C#
[SRCategory("AppearanceCategory")]
public virtual DataTemplate ContentTemplate { get; set; }

ContentTemplateSelector

DataTemplateSelector

Gets or sets the DataTemplateSelector that will be used to select a data template for the items that do not have a ContentTemplate set. This is a dependency property.

C#
[SRCategory("AppearanceCategory")]
public virtual DataTemplateSelector ContentTemplateSelector { get; set; }

Gets or sets the background of the tab strip. This is a dependency property.

C#
[SRCategory("AppearanceCategory")]
public virtual Brush HeaderBackground { get; set; }
Remarks:

This property gives you a quick way to change the tab strip background without having to modify the ControlTemplate of the TabControl.

Gets or sets a value indicating whether the state of the content will be preserved when selection is changed.

C#
public virtual bool IsContentPreserved { get; set; }
Property Value:

True if the first tab will preserve the content state; otherwise, false.

Gets or sets a value indicating whether the first tab item will be selected by default on start up.

C#
public bool IsDefaultItemSelected { get; set; }
Property Value:

True if the first tab item will be selected; otherwise, false.

Gets or sets a value indication whether the data context of the tab item should be assigned as DataContext of the content area when the selection changes. The default is true.

C#
public virtual bool PropagateItemDataContextToContent { get; set; }
Remarks:

In Silverlight the DataContext is inherited visually and it may be expected that the content of a tab item will have its DataContext. This property specifies that the DataContext of the content area will be changed to assure this.

Gets or sets whether the tab item rows would be reordered when selected. This is a dependency property.

C#
[SRCategory("BehaviourCategory")]
[SRDescription("TabControlReorderTabRowsDescription")]
public virtual bool ReorderTabRows { get; set; }
Remarks:

The ReorderTabRows property governs the behavior of the tab items when selected. Its effect can only be observed when more than one row of tab items are present.

Setting the property to true would make the rows in the TabStrip change place so that the selected item is always in the row nearest to the presented content (i.e. the bottommost row in a Top position, the rightmost column in a Left position, etc.)

Please note that the index of each item remains the same even when reordered.

The default value is true.

Gets the content of the selected item. This is a dependency property.

C#
[Browsable(false)]
public virtual object SelectedContent { get; set; }
Remarks:

The SelectedContent property returns the content of the currently selected item.

If no items are selected, the property would return null.

Gets the content template of the currently selected item. Do not set this property because it is changed internally. This is a dependency property.

C#
[Browsable(false)]
public virtual DataTemplate SelectedContentTemplate { get; set; }
Remarks:

The ContentTemplate property returns the content template of the currently selected item.

Note that the property cannot be set. To change the ContentTemplate of the tab items, use the and properties if an has been provided. Alternatively the can be used to assign a template on a per-item basis.

Gets the DataTemplateSelector for the currently selected item. Do not set this property because it is changed internally. This is a dependency property.

C#
[SRCategory("AppearanceCategory")]
[Browsable(false)]
public virtual DataTemplateSelector SelectedContentTemplateSelector { get; set; }

Determines what item should be selected when SelectedItem is removed.

C#
public SelectedItemRemoveBehaviour SelectedItemRemoveBehaviour { get; set; }

Gets or sets a value indicating whether the ContentPresenter rendering the tab items must refresh its data template on selection change. This property must be use in case when visual objects are used in the view model child collection bound to the tab control.

C#
public virtual bool SupressSelectedContentTemplateReapplying { get; set; }

Gets the flags.

C#
protected RadTabControlBase.TabControlState TabFlags { get; }

Gets or sets the tab strip. The tab strip visually represents the headers of tab items.

C#
protected Panel TabStrip { get; set; }
Property Value:

The tab strip.

Indexer, gets the tab item with the given index in the items collection.

C#
public virtual IRadTabItem this[int index] { get; }
Parameters:indexint

The index of the tab item in the Items collection of tab control.

Property Value:

The tab item with the given index in the Items collection of the tab control.

Remarks:

You can use the indexer to quickly get the item at given index. The indexer is a shortcut for the ContainerFromIndex method.

Note that you cannot use the indexer to change (replace) an item if you would like to do this use the property. If an invalid index is passed null is returned.

Methods

Adds a handler to the target for the DropDownClosed routed event.

C#
public static void AddDropDownClosedHandler(UIElement target, DropDownEventHandler handler)
Parameters:targetUIElement

The target element to add a handler to.

handlerDropDownEventHandler

The handler to add for this event.

Adds a handler to the target for the DropDownOpened routed event.

C#
public static void AddDropDownOpenedHandler(UIElement target, DropDownEventHandler handler)
Parameters:targetUIElement

The target element to add a handler to.

handlerDropDownEventHandler

The handler to add for this event.

Updates the visual states of the control.

C#
protected virtual void ChangeVisualState(bool useTransitions)
Parameters:useTransitionsbool

Identifies whether the transitions should be used.

Clears all ContentPresenter elements inside the ContentElementStorage template part and clears the ContentElement template part. Also clears the ContentElementStorage children used to represent content from different tab items.

C#
protected void ClearContentSafely()

Returns a new instance of the control that implements the IRadTabItem interface.

C#
protected virtual IRadTabItem GetContainer()
Returns:

IRadTabItem

Creates the element that is used to display the given item.

C#
protected override DependencyObject GetContainerForItemOverride()
Returns:

DependencyObject

Attempts to move the control to one of the states in the list.

C#
protected void GoToState(bool useTransitions, params string[] stateNames)
Parameters:useTransitionsbool

Indicates whether transitions should be used.

stateNamesstring[]

The names of the states that should be reached.

Determines if the specified item is (or is eligible to be) its own container.

C#
protected override bool IsItemItsOwnContainerOverride(object item)
Parameters:itemobject

The item to check.

Returns:

bool

True if the item is (or is eligible to be) its own container; otherwise, false.

Determines of user has no bindings to SelectedIndex or SelectedItem properties.

C#
protected virtual bool IsSelectionNonBoundAtClientSide()
Returns:

bool

Raises the PreviewSelectionChangedEvent.

C#
protected virtual void OnPreviewSelectionChanged(SelectionChangedEventArgs e)
Parameters:eSelectionChangedEventArgs

Raises the SelectionChanged routed event.

C#
protected virtual void OnSelectionChanged(RadSelectionChangedEventArgs e)
Parameters:eRadSelectionChangedEventArgs

Removes a handler to the target for the DropDownClosed routed event.

C#
public static void RemoveDropDownClosedHandler(UIElement target, DropDownEventHandler handler)
Parameters:targetUIElement

The target element to remove a handler from.

handlerDropDownEventHandler

The handler to remove for this element.

Removes a handler to the target for the DropDownOpened routed event.

C#
public static void RemoveDropDownOpenedHandler(UIElement target, DropDownEventHandler handler)
Parameters:targetUIElement

The target element to remove a handler from.

handlerDropDownEventHandler

The handler to remove for this element.

Handles the event of the Selector control.

C#
protected virtual void Selector_SelectionChanged(object sender, SelectionChangedEventArgs e)
Parameters:senderobject

The source of the event.

eSelectionChangedEventArgs

The instance containing the event data.

Updates the focus. This method should be called after selection of tab item in order to focus the appropriate element. If the focus is outside the tab or in the contents of the previously selected tab item then the first element in the selected tab contents will be focused. If the TabStrip is focused calling this method will focus the newly selected tab header.

C#
protected virtual void UpdateFocusOnSelectionChange()

Updates the selected content properties SelectedContent, SelectedContentTemplate and SelectedContentTemplateSelector. This method must be implemented appropriately in the deriving class. Selected content properties are used when representing the content of selected tab item.

C#
protected virtual void UpdateSelectedContentProperties()

Visually updates the tab rows.

C#
protected virtual void UpdateTabRows()

Events

An event that is raised when the DropDownMenu is closed. This is a RoutedEvent.

C#
public virtual event DropDownEventHandler DropDownClosed

An event that is raised when the DropDownMenu is opened. This is a RoutedEvent.

C#
public virtual event DropDownEventHandler DropDownOpened

The preview event for SelectionChanged event. Handling this event rollbacks the selection. This is a RoutedEvent.

C#
public event RadSelectionChangedEventHandler PreviewSelectionChanged

Occurs when a changed has been made to the selection. This is a RoutedEvent.

C#
[SRDescription("TabControlSelectionChangedDescription")]
public event RadSelectionChangedEventHandler SelectionChanged
In this article
DefinitionConstructorsRadTabControlBase()FieldsBackgroundVisibilityPropertyContentTemplatePropertyContentTemplateSelectorPropertyDropDownClosedEventDropDownOpenedEventHeaderBackgroundPropertyIsContentPreservedPropertyPreviewSelectionChangedEventPropagateItemDataContextToContentPropertyReorderTabRowsPropertySelectedContentPropertySelectedContentTemplatePropertySelectedContentTemplateSelectorPropertySelectedItemRemoveBehaviourPropertySelectionChangedEventPropertiesBackgroundVisibilityContentElementContentElementsPanelContentTemplateContentTemplateSelectorHeaderBackgroundIsContentPreservedIsDefaultItemSelectedPropagateItemDataContextToContentReorderTabRowsSelectedContentSelectedContentTemplateSelectedContentTemplateSelectorSelectedItemRemoveBehaviourSupressSelectedContentTemplateReapplyingTabFlagsTabStripthis[int]MethodsAddDropDownClosedHandler(UIElement, DropDownEventHandler)AddDropDownOpenedHandler(UIElement, DropDownEventHandler)ChangeVisualState(bool)ClearContentSafely()GetContainer()GetContainerForItemOverride()GoToState(bool, params string[])IsItemItsOwnContainerOverride(object)IsSelectionNonBoundAtClientSide()OnPreviewSelectionChanged(SelectionChangedEventArgs)OnSelectionChanged(RadSelectionChangedEventArgs)RemoveDropDownClosedHandler(UIElement, DropDownEventHandler)RemoveDropDownOpenedHandler(UIElement, DropDownEventHandler)Selector_SelectionChanged(object, SelectionChangedEventArgs)UpdateFocusOnSelectionChange()UpdateSelectedContentProperties()UpdateTabRows()EventsDropDownClosedDropDownOpenedPreviewSelectionChangedSelectionChanged
Not finding the help you need?
Contact Support