FlowDocument 생성자

정의

FlowDocument 클래스의 새 인스턴스를 초기화합니다.

오버로드

FlowDocument()

FlowDocument 클래스의 비어 있는 새 인스턴스를 초기화합니다.

FlowDocument(Block)

지정된 FlowDocument 요소를 초기 콘텐츠로 추가하여 Block 클래스의 새 인스턴스를 초기화합니다.

FlowDocument()

FlowDocument 클래스의 비어 있는 새 인스턴스를 초기화합니다.

public:
 FlowDocument();
public FlowDocument ();
Public Sub New ()

적용 대상

FlowDocument(Block)

지정된 FlowDocument 요소를 초기 콘텐츠로 추가하여 Block 클래스의 새 인스턴스를 초기화합니다.

public:
 FlowDocument(System::Windows::Documents::Block ^ block);
public FlowDocument (System.Windows.Documents.Block block);
new System.Windows.Documents.FlowDocument : System.Windows.Documents.Block -> System.Windows.Documents.FlowDocument
Public Sub New (block As Block)

매개 변수

block
Block

추상 Block 클래스에서 파생되며 초기 콘텐츠로 추가할 개체입니다.

예외

block이(가) null인 경우

예제

다음 예제에서는이 생성자를 사용 하는 방법을 보여 줍니다. 이 경우 단락에 FlowDocument 중첩된 텍스트 실행으로 구성된 흐름 요소 블록 구조가 포함됩니다.

FlowDocument flowDoc = new FlowDocument(new Paragraph(new Run("A bit of text content...")));
Dim flowDocSimple As New FlowDocument(New Paragraph(New Run("A bit of text content...")))

다음 예제에서는 프로그래밍 방식으로 간단한 2 x 2 테이블을 생성한 다음 생성자를 사용하여 FlowDocument 테이블을 포함하는 새 FlowDocument 테이블을 만듭니다. 다소 복잡한 흐름 요소 블록 구조가 사용되지만 생성자 사용은 이전 예제와 동일합니다.

// A paragraph with sample text will serve as table content.
Paragraph tableText = new Paragraph(new Run("A bit of text content..."));

Table sampleTable = new Table();

// Create and add a couple of columns.
sampleTable.Columns.Add(new TableColumn());
sampleTable.Columns.Add(new TableColumn());

// Create and add a row group and a couple of rows.
sampleTable.RowGroups.Add(new TableRowGroup());
sampleTable.RowGroups[0].Rows.Add(new TableRow());
sampleTable.RowGroups[0].Rows.Add(new TableRow());

// Create four cells initialized with the sample text paragraph.
sampleTable.RowGroups[0].Rows[0].Cells.Add(new TableCell(tableText));
sampleTable.RowGroups[0].Rows[0].Cells.Add(new TableCell(tableText));
sampleTable.RowGroups[0].Rows[1].Cells.Add(new TableCell(tableText));
sampleTable.RowGroups[0].Rows[1].Cells.Add(new TableCell(tableText));

// Finally, use the FlowDocument constructor to create a new FlowDocument containing 
// the table constructed above.
FlowDocument flowDoc = new FlowDocument(sampleTable);
    ' A paragraph with sample text will serve as table content.
    Dim tableText As New Paragraph(New Run("A bit of text content..."))

    Dim sampleTable As New Table()

    ' Create and add a couple of columns.
    sampleTable.Columns.Add(New TableColumn())
    sampleTable.Columns.Add(New TableColumn())

    ' Create and add a row group and a couple of rows.
    sampleTable.RowGroups.Add(New TableRowGroup())
    sampleTable.RowGroups(0).Rows.Add(New TableRow())
    sampleTable.RowGroups(0).Rows.Add(New TableRow())

    ' Create four cells initialized with the sample text paragraph.
    sampleTable.RowGroups(0).Rows(0).Cells.Add(New TableCell(tableText))
    sampleTable.RowGroups(0).Rows(0).Cells.Add(New TableCell(tableText))
    sampleTable.RowGroups(0).Rows(1).Cells.Add(New TableCell(tableText))
    sampleTable.RowGroups(0).Rows(1).Cells.Add(New TableCell(tableText))

    ' Finally, use the FlowDocument constructor to create a new FlowDocument containing 
    ' the table constructed above.
Dim flowDocTable As New FlowDocument(sampleTable)

설명

에 대 한 유효한 입력 형식 block 포함 BlockUIContainerList, ParagraphSection, 및 Table합니다.

적용 대상