# DXTabControl | WPF Controls | DevExpress Documentation

[DXTabControl](/WPF/DevExpress.Xpf.Core.DXTabControl) is designed to bring the tab-based navigation functionality to your applications.

![TabControl](/WPF/images/tabcontrol11490.png)

## Tab Control and Items Overview

[DXTabControl](/WPF/DevExpress.Xpf.Core.DXTabControl) is a navigation component that is used to build tabbed UI. The layout, style and behavior settings are defined by [Views](/WPF/7979/controls-and-libraries/layout-management/tab-control/fundamentals/views) objects. To apply a view to the tab control, create a view object and assign it to the [DXTabControl.View](/WPF/DevExpress.Xpf.Core.DXTabControl.View) property. To learn more about views, see [Views](/WPF/7979/controls-and-libraries/layout-management/tab-control/fundamentals/views).

Tab control’s items (pages) are represented by [DXTabItem](/WPF/DevExpress.Xpf.Core.DXTabItem) objects that are located in the [Items](https://learn.microsoft.com/dotnet/api/system.windows.controls.itemscontrol.items#system-windows-controls-itemscontrol-items) collection.

![TabControl_MultilineView_BeforeSelection](/WPF/images/tabcontrol_multilineview_beforeselection11499.png)

Structurally, each tab item consists of a header and content parts, specified by the **DXTabItem.Header** and **DXTabItem.Content** properties respectively. The templates defining the visual representation of the tab item’s header and content are specified using the **DXTabItem.HeaderTemplate** and **DXTabItem.ContentTemplate** properties. You can specify an icon to be displayed within the tab item’s header. To do this, use the [DXTabItem.Glyph](/WPF/DevExpress.Xpf.Core.DXTabItem.Glyph) or [DXTabItem.GlyphTemplate](/WPF/DevExpress.Xpf.Core.DXTabItem.GlyphTemplate) property.

**Caching Tab Items**

The [DXTabControl](/WPF/DevExpress.Xpf.Core.DXTabControl) does not cache its tabs by default. Set the [DXTabControl.TabContentCacheMode](/WPF/DevExpress.Xpf.Core.DXTabControl.TabContentCacheMode) property to [TabContentCacheMode.CacheAllTabs](/WPF/DevExpress.Xpf.Core.TabContentCacheMode) to make the [DXTabControl](/WPF/DevExpress.Xpf.Core.DXTabControl) load and cache its tab items after the control is shown. Caching tab items can significantly speed up navigation between tabs, but will consume more memory. 

Set the [DXTabControl.TabContentCacheMode](/WPF/DevExpress.Xpf.Core.DXTabControl.TabContentCacheMode) property to [TabContentCacheMode.CacheTabsOnSelecting](/WPF/DevExpress.Xpf.Core.TabContentCacheMode) to make the control cache a tab only after it was selected.

## Create DXTabItems

You can add tab items to the tab control in any of the following ways:

- Create [DXTabItem](/WPF/DevExpress.Xpf.Core.DXTabItem) objects and add them to the **DXTabControl.Items** collection.

- MainWindow.xaml

<section id="tabpanel_YCbnlGIig7_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;dx:DXTabControl&gt; 
    &lt;dx:DXTabItem Header=&quot;Page 1&quot;&gt; 
        &lt;Label Content=&quot;Hello, world!&quot;/&gt; 
    &lt;/dx:DXTabItem&gt; 
    &lt;dx:DXTabItem Header=&quot;Page 2&quot;&gt; 
        &lt;Label Content=&quot;DXTabControl&quot;/&gt; 
    &lt;/dx:DXTabItem&gt; 
&lt;/dx:DXTabControl&gt;
</code></pre></section>
- Add arbitrary objects (data items) to the **DXTabControl.Items** collection and specify the **DXTabControl.ItemTemplate** and **DXTabControl.ItemHeaderTemplate** templates that define how to present tab headers and pages, respectively. In this instance, [DXTabItem](/WPF/DevExpress.Xpf.Core.DXTabItem) objects will be generated from data items automatically.

- MainWindow.xaml

<section id="tabpanel_YCbnlGIig7-1_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;Grid&gt; 
    &lt;Grid.Resources&gt; 
        &lt;DataTemplate x:Key=&quot;ItemHeaderTemplate&quot;&gt; 
            &lt;TextBlock Text=&quot;{Binding HeaderText}&quot;/&gt; 
        &lt;/DataTemplate&gt; 
        &lt;DataTemplate x:Key=&quot;ItemContentTemplate&quot;&gt; 
            &lt;TextBlock Text=&quot;{Binding PageText}&quot;/&gt; 
        &lt;/DataTemplate&gt; 
    &lt;/Grid.Resources&gt; 
    &lt;dx:DXTabControl ItemHeaderTemplate=&quot;{StaticResource ItemHeaderTemplate}&quot; 
                     ItemTemplate=&quot;{StaticResource ItemContentTemplate}&quot; 
                     Name=&quot;dXTabControl1&quot;/&gt; 
&lt;/Grid&gt;
</code></pre></section>

- MainWindow.xaml.cs

<section id="tabpanel_YCbnlGIig7-2_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code class="lang-csharp">public class TabDataItem {
    public string PageText { get; set;}
    public string HeaderText { get; set;}
}
//... 
dXTabControl1.Items.Add(new TabDataItem() {
    HeaderText = &quot;Page 1&quot;, PageText = &quot;Hello, world!&quot; 
});
dXTabControl1.Items.Add(new TabDataItem() {
    HeaderText = &quot;Page 2&quot;, PageText = &quot;DXTabControl&quot; 
});
</code></pre></section>
- Bind the tab control to a data source. To do this, assign a data source to the **DXTabControl.ItemsSource** property. In this case, the control retrieves data items from the data source and add them to the **DXTabControl.Items** collection. Similar to the previous case, you should specify the **DXTabControl.ItemTemplate** and **DXTabControl.ItemHeaderTemplate** templates to define the tab headers and pages visual presentation.

- MainWindow.xaml

<section id="tabpanel_YCbnlGIig7-3_tabid-xaml" role="tabpanel" data-tab="tabid-xaml">
<pre><code class="lang-xaml">&lt;Window ...
    xmlns:dx=&quot;http://schemas.devexpress.com/winfx/2008/xaml/core&quot;/&gt;
    &lt;Grid&gt;
        &lt;Grid.Resources&gt;
            &lt;DataTemplate x:Key=&quot;ItemHeaderTemplate&quot;&gt;
                &lt;TextBlock Text=&quot;{Binding HeaderText}&quot;/&gt;
            &lt;/DataTemplate&gt;
            &lt;DataTemplate x:Key=&quot;ItemContentTemplate&quot;&gt;
                &lt;TextBlock Text=&quot;{Binding PageText}&quot;/&gt;
            &lt;/DataTemplate&gt;
        &lt;/Grid.Resources&gt;
        &lt;dx:DXTabControl ItemHeaderTemplate=&quot;{StaticResource ItemHeaderTemplate}&quot; 
                         ItemTemplate=&quot;{StaticResource ItemContentTemplate}&quot; 
                         Name=&quot;dXTabControl1&quot; ItemsSource=&quot;{Binding}&quot;/&gt;

    &lt;/Grid&gt;
&lt;/Window&gt;
</code></pre></section>

- MainWindow.xaml.cs

<section id="tabpanel_YCbnlGIig7-4_tabid-csharp" role="tabpanel" data-tab="tabid-csharp">
<pre><code class="lang-csharp">public partial class MainWindow : Window
{
public class TabDataItem
{
    public string PageText { get; set; }
    public string HeaderText { get; set; }
}

    public MainWindow()
    {
        InitializeComponent();
        this.DataContext = new ObservableCollection&lt;TabDataItem&gt;() {
        new TabDataItem() { HeaderText = &quot;Page 1&quot;, PageText = &quot;Hello, world!&quot; },
        new TabDataItem() { HeaderText = &quot;Page 2&quot;, PageText = &quot;DXTabControl&quot; }
    };
    }
}
</code></pre></section>

      To learn more about a binding a tab control to data, see [Binding to Data Overview](/WPF/7978/controls-and-libraries/layout-management/tab-control/concepts/binding-to-data-overview).