■ FlowDocument 클래스의 Blocks 속성을 사용해 첫번째 블럭 앞에 문단을 삽입하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 |
using System.Windows.Documents; FlowDocument flowDocument = new FlowDocument(new Paragraph(new Run("A bit of text content..."))); flowDocument.Blocks.Add(new Paragraph(new Run("Text to append..."))); Paragraph paragraph = new Paragraph(new Run("Text to insert...")); flowDocument.Blocks.InsertBefore(flowDocument.Blocks.FirstBlock, paragraph); |