■ FlowDocument 클래스를 사용해 텍스트를 구하는 방법을 보여준다.
▶ 예제 코드 (C#)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
using System.Windows.Documents; #region 텍스트 구하기 - GetText(flowDocument) /// <summary> /// 텍스트 구하기 /// </summary> /// <param name="flowDocument">플로우 문서</param> /// <returns>텍스트</returns> public string GetText(FlowDocument flowDocument) { TextRange textRange = new TextRange(flowDocument.ContentStart, flowDocument.ContentEnd); return textRange.Text; } #endregion |