<p>How can I detect the current text formatting at the cursor position in a WPF RichTextBox?</p>

Try the code below where rtb is the RichTextBox:
```
```
TextRange tr = new TextRange(rtb.Selection.Start, rtb.Selection.End);
object oFont = tr.GetPropertyValue(Run.FontFamilyProperty);
```
```