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.
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>
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:
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.