• North American Sales: 1-800-231-8588
  • Global Contacts
  • My Account
Infragistics Infragistics
Menu
  • North American Sales: 1-800-321-8588
  • My Account
    • Sign In/Register
  • Design & DevelopmentDesign & Develop
    • Best Value
      Infragistics Ultimate The complete toolkit for building high performing web, mobile and desktop apps.
      Indigo.Design Use a unified platform for visual design, UX prototyping, code generation and application development.
    • Web
      Ignite UI for Angular Ignite UI for JavaScript Ignite UI for React Ultimate UI for ASP.NET Indigo.Design
    • Desktop
      Ultimate UI for Windows Forms Ultimate UI for WPF
      Prototyping
      Indigo.Design
    • Mobile
      Ultimate UI for Xamarin Ultimate UI for iOS Ultimate UI for Android
    • Automated Testing Tools
      Test Automation for Micro Focus UFT: Windows Forms Test Automation for Micro Focus UFT: WPF Test Automation for IBM RFT: Windows Forms
  • UX
    • Indigo.Design Desktop Collaborative prototyping and remote usability testing for UX & usability professionals
    • Indigo.Design A Unified Platform for Visual Design, UX Prototyping, Code Generation, and App Development
  • Business Intelligence
    • Reveal Embedded Accelerate your time to market with powerful, beautiful dashboards into your apps
    • Reveal App Empower everyone in your organization to use data to make smarter business decisions
  • Team Productivity
  • Learn & Support Support
    • Help & Support Documents
    • Blogs
    • Forums
    • Product Ideas
    • Reference Applications
    • Customer Stories
    • Webinars
    • eBook & Whitepapers
    • Events
  • Free Trials
  • Pricing
    • Product Pricing / Buy Online
    • Renew Existing License
    • Contact Us
WPF
  • Product Platforms
  • More
WPF
WPF Configuring the XamTab Control
  • Blog
  • Files
  • Wiki
  • Mentions
  • Tags
  • More
  • Cancel
  • New
WPF requires membership for participation - click to join
  • WPF
  • Configuring the XamTab Control
  • Creating a Custom Summary for the XamDataGrid
  • Defining a Custom Path in the XamCarousel
  • Enabling Row Summaries in the XamDataGrid
  • Exporting the XamDataGrid to Excel
  • Hosting a WPF Control in a Windows Forms Application
  • Printing the XamDataGrid with Infragistics.Reports
  • Spell Checking in the XamDataGrid
  • Tangerine -- A WPF Reference Application
  • Using the Infragistics WinGrid in a WPF Application
  • Validation in the XamDataGrid
  • XamDataGrid :: Copying to Excel via the Clipboard
  • XML Databinding with the XamDataGrid

Configuring the XamTab Control

Introduction

The XamTab Control was a control that was written in part to support the development of the XamRibbon. It supports a few additional features that will make it easy for a developer to create a familiar tabbed experience.


Setting up the Tab Control

To start, the developer should add the Infragistics3.Wpf dll to their project (or just drag the tab onto the design surface). The basic tab definition in xaml should look something like this:

<Window x:Class="XamCommunitySample.MainWindow1"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"  
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"  
    Title="Main Window Sample" Height="600" Width="800"  
        …   
        xmlns:igWindows="http://infragistics.com/Windows"  
         …   
>  
…   
  <igWindows:XamTabControl x:Name="xamTab1" Theme="Office2k7Blue">  
     <igWindows:TabItemEx Header="Tab1">  
         <!--Content-->  
     </igWindows:TabItemEx>  
     <igWindows:TabItemEx Header="Tab2">  
         <!--Content-->  
     </igWindows:TabItemEx>  
  </igWindows:XamTabControl>  
…   
</Window>  


Customizing the Tab Control

Then you have the ability to customize the layout of the tab control; where tabs are placed, if they scroll, or are stacked, and the ability to close them.

To control where Tabs are placed you are given the option of positioning tabs on the top, left, bottom, or right of the content by setting the TabStripPlacement Property. You can also determine how the tabs are displayed in each of these locations by setting the TabLayoutStyle property to one of the following:

  • MultiRowAutoSize – Allows for multiple rows of tabs and sized based on their content
  • MultiRowSizeToFit – Allows for multiple rows of tabs and sized based on their content and then allowed to grow in size if more room to display the items is available.
  • SingleRowAutoSize – Allows for a single row of tab that is sized based on the size of the content.
  • SingleRowJustified – Allows for a single row of tabs that is sized first based on their content and then reduced in size if there is not enough room to fit the items.
  • SingleRowSizeToFit – Allows for a single row of tabs that is sized based on their content and then allowed to grow in size if more room to display the items is available.

To give the tab the ability to close, simply set the TabItemCloseButtonVisibility property. This property takes one of four different self-descriptive settings: hidden, visible, WhenSelected, and WhenSelectedOrHotTracked. All of the above settings can be set off the base Tab control like this:

<igWindows:XamTabControl x:Name="xamTab1" Theme="Office2k7Blue"    
           TabStripPlacement="Top" TabLayoutStyle="SingleRowSizeToFit"    
           TabItemCloseButtonVisibility="WhenSelectedOrHotTracked"> 

Lastly, another interesting feature about the tab control is the ability to have some sort of content injected in front of or following the tabs. This is useful for adding your own custom buttons or items that should span across multiple tabs. To do this simply insert some sort of content into either the PreTabItemContent or the PostTabItemContent like this:

<igWindows:XamTabControl.PostTabItemContent>  
  <StackPanel Orientation="Horizontal">  
     <Button Margin="0,0,0,0" Click="Button_Click">Print Content</Button>  
  </StackPanel>  
</igWindows:XamTabControl.PostTabItemContent>  

 
The tab control with its additional styling capability by setting the theme property definitely gives you the ability to easily create the tabbed browsing experience popular in many current Windows Client application.

  • WPF
  • XamTab
  • Share
  • History
  • More
  • Cancel
Related
Recommended