共用方式為


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 使用 屬性將內容附加至 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

適用於

另請參閱