Please see my comment to the question.
This is how you can do it in XAML:
http://www.wpf-tutorial.com/rich-text-controls/richtextbox-control[
^].
To format some part of the document on the fly, you need to obtain some text range,
System.Windows.Documents.TextRange
:
https://msdn.microsoft.com/en-us/library/system.windows.documents.textrange%28v=vs.110%29.aspx[
^].
As you can see from the inheritance diagram, it can be, for example, selection.
Now you can apply some formatting for the range (which can be applicable or not; in your case, it has to be some block element, such as a paragraph). You will find the way to do it here:
https://msdn.microsoft.com/en-us/library/system.windows.documents.textrange.applypropertyvalue%28v=vs.110%29.aspx[
^].
Look at the code sample at the end.
—SA