Imports Infragistics.Windows.DockManager
' this sample assumes you have a XamDockManager whose Content
' is set to a DocumentContentHost. calling AddDocument when
' the dockmanager is not using a DocumentContentHost will
' result in an exception
Private Sub btnAddDocument_Click(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim header As Object = "New File"
Dim content As Object = New RichTextBox()
' the AddDocument method will create a new ContentPane for
' the given header & content and put that content pane in
' the tabgrouppane containing the active pane or a new
' tabgrouppane if there aren't any available
Dim newDocument As ContentPane = Me.dmForAddDocument.AddDocument(header, content)
newDocument.AllowDocking = False
newDocument.AllowFloatingOnly = False
' the adddocument method doesn't automatically activate the pane
' in case you wanted to add multiple panes
newDocument.Activate()
End Sub