Before You Begin
You don't have to learn a new object model to create a tabbed Multiple Document Interface (MDI) application with xamDockManager™. You can leverage your existing knowledge of xamDockManager and Microsoft® Windows® Presentation Foundation to create a tabbed MDI application.
What You Will Accomplish
You will use content panes and the DocumentContentHost object to create a tabbed MDI application. Each content pane in the DocumentContentHost object will be displayed in a separate tab.
Follow these Steps
- Add a xamDockManager control to your Window and name it.
In XAML:
<igDock:XamDockManagerName="xamDockManager1"><!--TODO: Add a DocumentContentHost here--></igDock:XamDockManager> - Set xamDockManager's Content property to an instance of a DocumentContentHost. In XAML, you do not have to explicitly declare the tags for the Content property.
In XAML:
<igDock:DocumentContentHost><!--TODO: Add a SplitPane here--></igDock:DocumentContentHost>In Visual Basic:
ImportsInfragistics.Windows.DockManager ...DimdocumentContentHost1AsNewDocumentContentHost()Me.xamDockManager1.Content = documentContentHost1In C#:
usingInfragistics.Windows.DockManager; ... DocumentContentHost documentContentHost1 =newDocumentContentHost();this.xamDockManager1.Content = documentContentHost1; - Add a SplitPane object to the DocumentContentHost object's Panes collection. You do not have to explicitly declare tags for the DocumentContentHost object's Panes collection.
In XAML:
<igDock:SplitPane><!--TODO: Add a TabGroupPane here--></igDock:SplitPane>In Visual Basic:
DimsplitPane1AsNewSplitPane() documentContentHost1.Panes.Add(splitPane1)In C#:
SplitPane splitPane1 =newSplitPane(); documentContentHost1.Panes.Add(splitPane1); - Add a TabGroupPane object to the SplitPane object's Panes collection. You do not have to explicitly declare tags for the SplitPane object's Panes collection.
In XAML:
<igDock:TabGroupPane><!--TODO: Add ContentPanes here--></igDock:TabGroupPane>In Visual Basic:
DimtabGroupPane1AsNewTabGroupPane() splitPane1.Panes.Add(tabGroupPane1)In C#:
TabGroupPane tabGroupPane1 =newTabGroupPane(); splitPane1.Panes.Add(tabGroupPane1); - Add a ContentPane object to the TabGroupPane object's Items collection. You do not have to explicitly declare tags for the TabGroupPane object's Items collection.
The content panes in the DocumentContentHost object behave like regular content panes. This means your end users will be able to dock or float them at run time. You can restrict this behavior by setting the AllowDocking property and the AllowFloatingOnly property of the content pane to False.
In XAML:
<!--You can set the AllowDocking and AllowFloatingOnly properties using a Style instead of setting them on each content pane--><igDock:ContentPaneHeader="Document1.xaml"AllowDocking="False"AllowFloatingOnly="False"><!--TODO: Add content here--></igDock:ContentPane>In Visual Basic:
DimcontentPane1AsNewContentPane() contentPane1.Header ="Document1.xaml"'If you created a Style to set the AllowDocking and AllowFloatingOnly properties of a content pane, you do not have to set them herecontentPane1.AllowDocking =FalsecontentPane1.AllowFloatingOnly =FalsetabGroupPane1.Items.Add(contentPane1)In C#:
ContentPane contentPane1 =newContentPane(); contentPane1.Header ="Document1.xaml";//If you created a Style to set the AllowDocking and AllowFloatingOnly properties of a content pane, you do not have to set them herecontentPane1.AllowDocking =false; contentPane1.AllowFloatingOnly =false; tabGroupPane1.Items.Add(contentPane1); - Set the ContentPane's Content property. The ContentPane object is a content control; therefore, you can use it just like any content control in Windows Presentation Foundation.
In XAML:
<RichTextBoxVerticalScrollBarVisibility="Auto"/>In Visual Basic:
DimrichTextBox1AsNewRichTextBox() richTextBox1.VerticalScrollBarVisibility = ScrollBarVisibility.Auto contentPane1.Content = richTextBox1In C#:
RichTextBox richTextBox1 =newRichTextBox(); richTextBox1.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; contentPane1.Content = richTextBox1; - Dynamically add a second content pane (tab) to the DocumentContentHost object.
The example code below demonstrates how to add a content pane (tab) by calling the AddDocument method. Calling the AddDocument method is a convenient way of dynamically adding a new content pane to the DocumentContentHost object. You can also instantiate a new ContentPane object and add it to the TabGroupPane object's Items collection if you do not want to use the AddDocument method.
In Visual Basic:
DimrichTextBox2AsNewRichTextBox() richTextBox2.VerticalScrollBarVisibility = ScrollBarVisibility.AutoDimcontentPane2AsContentPane =Me.xamDockManager1.AddDocument("Document2.xaml", richTextBox2) contentPane2.AllowDocking =FalsecontentPane2.AllowFloatingOnly =FalseIn C#:
RichTextBox richTextBox2 =newRichTextBox(); richTextBox2.VerticalScrollBarVisibility = ScrollBarVisibility.Auto; ContentPane contentPane2 =this.xamDockManager1.AddDocument("Document2.xaml", richTextBox2); contentPane2.AllowDocking =false; contentPane2.AllowFloatingOnly =false; - Run the project to see two tabs named "Document1.xaml" and "Document2.xaml".

About Opening and Closing Panes
Add Panes to the DocumentContentHost Object
Prevent End Users From Resizing Floating Panes
Set the Location of a Floating Pane
Set the Initial Location of a Pane
Set the Size of a Floating Pane
Show the Pane Navigator Programmatically
