Class
RadTabControlBase

A base class providing functionality to controls used to create tabbed interfaces.

Definition

Namespace:Telerik.UI.Xaml.Controls

Assembly:Telerik.WinUI.Controls.dll

Syntax:

cs-api-definition
public abstract class RadTabControlBase : RadSelector

Inheritance: objectRadItemsControlRadSelectorRadTabControlBase

Derived Classes: RadRibbonBackstageRadRibbonViewRadTabControl

Inherited Members RadSelector.SelectedValuePathPropertyRadSelector.SelectedValuePropertyRadSelector.IsSelectedPropertyRadSelector.SelectedIndexPropertyRadSelector.SelectedItemPropertyRadSelector.SelectedEventRadSelector.UnselectedEventRadSelector.GetIsSelected(DependencyObject)RadSelector.AddSelectedHandler(DependencyObject, RoutedEventHandler)RadSelector.AddUnselectedHandler(DependencyObject, RoutedEventHandler)RadSelector.RemoveSelectedHandler(DependencyObject, RoutedEventHandler)RadSelector.RemoveUnselectedHandler(DependencyObject, RoutedEventHandler)RadSelector.SetIsSelected(DependencyObject, bool)RadSelector.OnItemsChanged(object)RadSelector.OnSelectedValueChanged(object, object)RadSelector.OnSelectionChanged(SelectionChangedEventArgs)RadSelector.OnSelectedValuePathChanged(string, string)RadSelector.SelectedValuePathRadSelector.SelectedValueRadSelector.SelectedIndexRadSelector.SelectedItemRadItemsControl.PrepareContainerForItemOverride(DependencyObject, object)

Constructors

RadTabControlBase()

Initializes a new instance of the RadTabControlBase class.

Declaration

cs-api-definition
protected RadTabControlBase()

Fields

BackgroundVisibilityProperty

Identifies the BackgroundVisibility property.

Declaration

cs-api-definition
public static readonly DependencyProperty BackgroundVisibilityProperty

Field Value

DependencyProperty

ContentTemplateProperty

Identifies the ContentTemplate property.

Declaration

cs-api-definition
public static readonly DependencyProperty ContentTemplateProperty

Field Value

DependencyProperty

ContentTemplateSelectorProperty

Identifies the ContentTemplateSelector property.

Declaration

cs-api-definition
public static readonly DependencyProperty ContentTemplateSelectorProperty

Field Value

DependencyProperty

DropDownClosedEvent

Identifies the DropDownClosed routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent DropDownClosedEvent

Field Value

RoutedEvent

DropDownOpenedEvent

Identifies the DropDownOpened routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent DropDownOpenedEvent

Field Value

RoutedEvent

HeaderBackgroundProperty

Identifies the HeaderBackground property.

Declaration

cs-api-definition
public static readonly DependencyProperty HeaderBackgroundProperty

Field Value

DependencyProperty

IsContentPreservedProperty

Identifies the IsContentPreserved property.

Declaration

cs-api-definition
public static readonly DependencyProperty IsContentPreservedProperty

Field Value

DependencyProperty

PreviewSelectionChangedEvent

Identifies the PreviewSelectionChanged routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent PreviewSelectionChangedEvent

Field Value

RoutedEvent

PropagateItemDataContextToContentProperty

Identifies the PropagateItemDataContextToContent property.

Declaration

cs-api-definition
public static readonly DependencyProperty PropagateItemDataContextToContentProperty

Field Value

DependencyProperty

ReorderTabRowsProperty

Identifies the ReorderTabRows property.

Declaration

cs-api-definition
public static readonly DependencyProperty ReorderTabRowsProperty

Field Value

DependencyProperty

SelectedContentProperty

Identifies the SelectedContent property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedContentProperty

Field Value

DependencyProperty

SelectedContentTemplateProperty

Identifies the SelectedContentTemplate property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedContentTemplateProperty

Field Value

DependencyProperty

SelectedContentTemplateSelectorProperty

Identifies the SelectedContentTemplateSelector property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedContentTemplateSelectorProperty

Field Value

DependencyProperty

SelectedItemRemoveBehaviourProperty

Identifies the SelectedItemRemoveBehaviour property.

Declaration

cs-api-definition
public static readonly DependencyProperty SelectedItemRemoveBehaviourProperty

Field Value

DependencyProperty

SelectionChangedEvent

Identifies the SelectionChanged routed event.

Declaration

cs-api-definition
public static readonly RoutedEvent SelectionChangedEvent

Field Value

RoutedEvent

Properties

BackgroundVisibility

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

Declaration

cs-api-definition
public virtual Visibility BackgroundVisibility { get; set; }

Property Value

Visibility

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

The ContentElement template part.

Declaration

cs-api-definition
protected ContentPresenter ContentElement { get; set; }

Property Value

ContentPresenter

The content element.

ContentElementsPanel

The ContentElementsPanel template part.

Declaration

cs-api-definition
protected Grid ContentElementsPanel { get; set; }

Property Value

Grid

The content element.

ContentTemplate

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

Declaration

cs-api-definition
public virtual DataTemplate ContentTemplate { get; set; }

Property Value

DataTemplate

ContentTemplateSelector

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.

Declaration

cs-api-definition
public virtual DataTemplateSelector ContentTemplateSelector { get; set; }

Property Value

DataTemplateSelector

HeaderBackground

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

Declaration

cs-api-definition
public virtual Brush HeaderBackground { get; set; }

Property Value

Brush

Remarks

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

IsContentPreserved

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

Declaration

cs-api-definition
public virtual bool IsContentPreserved { get; set; }

Property Value

bool

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

IsDefaultItemSelected

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

Declaration

cs-api-definition
public bool IsDefaultItemSelected { get; set; }

Property Value

bool

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

PropagateItemDataContextToContent

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.

Declaration

cs-api-definition
public virtual bool PropagateItemDataContextToContent { get; set; }

Property Value

bool

ReorderTabRows

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

Declaration

cs-api-definition
public virtual bool ReorderTabRows { get; set; }

Property Value

bool

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.

SelectedContent

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

Declaration

cs-api-definition
[Browsable(false)]
public virtual object SelectedContent { get; set; }

Property Value

object

Remarks

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

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

SelectedContentTemplate

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

Declaration

cs-api-definition
[Browsable(false)]
public virtual DataTemplate SelectedContentTemplate { get; set; }

Property Value

DataTemplate

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 System.Windows.Controls.ItemsControl.ItemTemplate and properties if an System.Windows.Controls.ItemsControl.ItemsSource has been provided. Alternatively the can be used to assign a template on a per-item basis.

SelectedContentTemplateSelector

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

Declaration

cs-api-definition
[Browsable(false)]
public virtual DataTemplateSelector SelectedContentTemplateSelector { get; set; }

Property Value

DataTemplateSelector

SelectedItemRemoveBehaviour

Determines what item should be selected when SelectedItem is removed.

Declaration

cs-api-definition
public SelectedItemRemoveBehaviour SelectedItemRemoveBehaviour { get; set; }

Property Value

SelectedItemRemoveBehaviour

TabFlags

Gets the flags.

Declaration

cs-api-definition
protected RadTabControlBase.TabControlState TabFlags { get; }

Property Value

RadTabControlBase.TabControlState

TabStrip

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

Declaration

cs-api-definition
protected Panel TabStrip { get; set; }

Property Value

Panel

The tab strip.

this[int]

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

Declaration

cs-api-definition
public virtual IRadTabItem this[int index] { get; }

Parameters

index

int

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

Property Value

IRadTabItem

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 System.Windows.Controls.ItemsControl.Items property. If an invalid index is passed null is returned.

Methods

ClearContentSafely()

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.

Declaration

cs-api-definition
protected void ClearContentSafely()

GetContainer()

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

Declaration

cs-api-definition
protected virtual IRadTabItem GetContainer()

Returns

IRadTabItem

GetContainerForItemOverride()

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

Declaration

cs-api-definition
protected override DependencyObject GetContainerForItemOverride()

Returns

DependencyObject

GoToState(bool, params string[])

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

Declaration

cs-api-definition
protected void GoToState(bool useTransitions, params string[] stateNames)

Parameters

useTransitions

bool

Indicates whether transitions should be used.

stateNames

string[]

The names of the states that should be reached.

IsItemItsOwnContainerOverride(object)

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

Declaration

cs-api-definition
protected override bool IsItemItsOwnContainerOverride(object item)

Parameters

item

object

The item to check.

Returns

bool

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

IsSelectionNonBoundAtClientSide()

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

Declaration

cs-api-definition
protected virtual bool IsSelectionNonBoundAtClientSide()

Returns

bool

OnPreviewSelectionChanged(SelectionChangedEventArgs)

Raises the PreviewSelectionChangedEvent.

Declaration

cs-api-definition
protected virtual void OnPreviewSelectionChanged(SelectionChangedEventArgs e)

Parameters

e

SelectionChangedEventArgs

OnSelectionChanged(RadSelectionChangedEventArgs)

Raises the SelectionChanged routed event.

Declaration

cs-api-definition
protected virtual void OnSelectionChanged(RadSelectionChangedEventArgs e)

Parameters

e

RadSelectionChangedEventArgs

Selector_SelectionChanged(object, SelectionChangedEventArgs)

Handles the Selector.SelectionChanged event of the Selector control.

Declaration

cs-api-definition
protected virtual void Selector_SelectionChanged(object sender, SelectionChangedEventArgs e)

Parameters

sender

object

The source of the event.

e

SelectionChangedEventArgs

The instance containing the event data.

UpdateSelectedContentProperties()

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.

Declaration

cs-api-definition
protected virtual void UpdateSelectedContentProperties()

UpdateTabRows()

Visually updates the tab rows.

Declaration

cs-api-definition
protected virtual void UpdateTabRows()

Events

DropDownClosed

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

Declaration

cs-api-definition
public virtual event DropDownEventHandler DropDownClosed

Event Value

DropDownEventHandler

DropDownOpened

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

Declaration

cs-api-definition
public virtual event DropDownEventHandler DropDownOpened

Event Value

DropDownEventHandler

PreviewSelectionChanged

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

Declaration

cs-api-definition
public event RadSelectionChangedEventHandler PreviewSelectionChanged

Event Value

RadSelectionChangedEventHandler

SelectionChanged

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

Declaration

cs-api-definition
public event RadSelectionChangedEventHandler SelectionChanged

Event Value

RadSelectionChangedEventHandler