다음을 통해 공유


FlowDocument.ContentStart 속성

정의

TextPointer에 있는 콘텐츠의 시작 부분을 나타내는 FlowDocument를 가져옵니다.

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

속성 값

TextPointer

TextPointerContext에 있는 콘텐츠의 시작 부분을 나타내는 FlowDocument입니다.

예제

다음 예제에서는 속성을 사용 하 여 ContentStart 시작 부분에 콘텐츠를 삽입 합니다 FlowDocument.

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

// Insert an initial paragraph at the beginning 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."
)));
// Insert a line-break at the beginnign of the document, before the previously inserted paragraph.
flowDoc.Blocks.InsertBefore(flowDoc.Blocks.FirstBlock, new Paragraph(new LineBreak()));
// Insert another paragraph at the beginning of the document.
flowDoc.Blocks.InsertBefore(flowDoc.Blocks.FirstBlock, new Paragraph(new Run(
    "This paragraph will be inserted before the previously added paragraph, replacing the previously" +
    "added paragraph as the first paragraph in the document."
)));
    ' Create a new, empty FlowDocument.
Dim flowDocStart As New FlowDocument()

    ' Insert an initial paragraph at the beginning of the empty FlowDocument.
flowDocStart.Blocks.Add(New Paragraph(New Run("Since the new FlowDocument is empty at this point, this will be the initial content " & "in the FlowDocument.")))
    ' Insert a line-break at the beginnign of the document, before the previously inserted paragraph.
flowDocStart.Blocks.InsertBefore(flowDocStart.Blocks.FirstBlock, New Paragraph(New LineBreak()))
    ' Insert another paragraph at the beginning of the document.
flowDocStart.Blocks.InsertBefore(flowDocStart.Blocks.FirstBlock, New Paragraph(New Run("This paragraph will be inserted before the previously added paragraph, replacing the previously" & "added paragraph as the first paragraph in the document.")))

설명

합니다 ContentStart 속성의 시작 부분에 콘텐츠를 삽입 하는 대개는 FlowDocument합니다.

TextPointer 이 속성에서 반환한 항상 해당 LogicalDirectionLogicalDirection.Backward합니다.

적용 대상

추가 정보