FlowDocument.ContentStart Свойство

Определение

Получение TextPointer, представляющего начало содержимого в FlowDocument.

C#
public System.Windows.Documents.TextPointer ContentStart { get; }

Значение свойства

TextPointerContext, представляющего начало содержимого в FlowDocument.

Примеры

В следующем примере свойство используется ContentStart для вставки содержимого FlowDocumentв начало .

C#
// 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."
)));

Комментарии

Свойство ContentStart часто используется для вставки содержимого в начало FlowDocument.

Объект , TextPointer возвращаемый этим свойством, всегда имеет LogicalDirection значение LogicalDirection.Backward.

Применяется к

Продукт Версии
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

См. также раздел