FindCriteria fc = new FindCriteria();
fc.CaseSensitive = this.cbCase.IsChecked ?? false;
fc.Operator =
(this.cbWildcard.IsChecked.HasValue && this.cbWildcard.isChecked.Value) ?
FindOperator.Wildcard : FindOperator.PlainText;
DocumentSpan ds = this.xamRichTextEditor1.Document.RootNode.Body.GetDocumentSpan();
string errorMsg;
FindResult fr = this.xamRichTextEditor1.Document.FindAll(ds,
"text-to-find", out errorMsg, fc);
if (fr.HasMatch)
{
foreach (FindMatch fm in fr.Matches)
{
// 各検索一致のドキュメント範囲を取得
DocumentSpan span = fm.Span;
}
}