FlowDocument.ContentEnd 属性

定义

获取表示 TextPointer 中内容末尾的 FlowDocument

public:
 property System::Windows::Documents::TextPointer ^ ContentEnd { System::Windows::Documents::TextPointer ^ get(); };
public System.Windows.Documents.TextPointer ContentEnd { get; }
member this.ContentEnd : System.Windows.Documents.TextPointer
Public ReadOnly Property ContentEnd As TextPointer

属性值

TextPointer

表示 TextPointer 中内容末尾的 FlowDocument

示例

以下示例使用 ContentEnd 属性将内容追加到 a FlowDocument.

// Create a new, empty FlowDocument.
FlowDocument flowDoc = new FlowDocument();

// Append an initial paragraph at the "end" of the empty FlowDocument.
flowDoc.Blocks.Add(new Paragraph(new Run(
    "Since the new FlowDocument is empty at this point, this will be the initial content " +
    "in the FlowDocument."
)));
// Append a line-break.
flowDoc.Blocks.Add(new Paragraph(new LineBreak()));
// Append another paragraph.
flowDoc.Blocks.Add(new Paragraph(new Run(
    "This text will be in a paragraph that is inserted at the end of the FlowDocument.")));
    ' Create a new, empty FlowDocument.
Dim flowDocEnd As New FlowDocument()

    ' Append an initial paragraph at the "end" of the empty FlowDocument.
flowDocEnd.Blocks.Add(New Paragraph(New Run("Since the new FlowDocument is empty at this point, this will be the initial content " & "in the FlowDocument.")))
    ' Append a line-break.
flowDocEnd.Blocks.Add(New Paragraph(New LineBreak()))
    ' Append another paragraph.
flowDocEnd.Blocks.Add(New Paragraph(New Run("This text will be in a paragraph that is inserted at the end of the FlowDocument.")))

注解

ContentEnd 属性通常用于将内容追加到末尾 FlowDocument

TextPointer此属性返回的始终设置为 LogicalDirection LogicalDirection.Forward

适用于

另请参阅