// obtains the start and the end of the selection
int startIndex = this.xamRichTextEditor1.ActiveDocumentView.Selection.Start;
int endOffset = this.xamRichTextEditor1.ActiveDocumentView.Selection.End;
string text = this.xamRichTextEditor1.ActiveDocumentView.Selection.Text;