バージョン

AddDocument メソッド

関連付けられた DocumentContentHostContentPane を追加します
シンタックス
'宣言
 
Public Function AddDocument( _
   ByVal header As Object, _
   ByVal content As Object _
) As ContentPane
public ContentPane AddDocument( 
   object header,
   object content
)

パラメータ

header
新しい ContentPaneSystem.Windows.Controls.HeaderedContentControl.Header プロパティの値。
content
新しい ContentPaneSystem.Windows.Controls.ContentControl.Content プロパティの値。
例外
例外解説
System.InvalidOperationExceptionContent プロパティは、DocumentContentHost に設定されなければなりません。
使用例
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
using 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 void btnAddDocument_Click(object sender, RoutedEventArgs e)
{
	object header = "New File";
	object content = 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
	ContentPane newDocument = this.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();
}
参照