Posted by: Zeeshan Amjad | August 17, 2009

Primitives Panels in WPF: TabPanel

In WPF all the layout are defined by inheriting the Panel class. There are two main categories of layout classes. One is main layout classes and other are primitive panel class. These types are defined in two different namespaces names System.Windows.Controls and System.Windows.Controls.Primitives. This relationship is defined in the following diagrams.


TabPanel is defined in Primitives namespace. This panel is internally used by the tab control. This panel also places the controls in multiple rows if there isn’t enough spaces available just like tab control.

Here is a simple XAML file to show the usage of TabPanel.

  1: <Window x:Class="xamlTabPanel.Window1"
  2:     xmlns=""
  3:     xmlns:x=""
  4:     Title="TabPanel" Height="300" Width="400">
  6:     <TabPanel>
  7:         <Button>Maryland</Button>
  8:         <Button>Virginia</Button>
  9:         <Button>West Virginia</Button>
 10:         <Button>Pennsylvania</Button>
 11:         <Button>Delaware</Button>
 12:         <Button>New Jersey</Button>
 13:         <Button>New York</Button>
 14:     </TabPanel>
 15: </Window>

Here is the output of this program.




  1. […] define in System.Windows.Controls.Primitives namespace. We have already saw the example of TabPanel here. Here is a class diagram of all classes inherited by Panel […]

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


%d bloggers like this: