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)
{
// obtain document span for each find match
DocumentSpan span = fm.Span;
}
}