What extensibility is needed? Usually, when it comes to changing the default behavior of any WPF control that cannot be changed using inheritance, we use Attached Properties .
Here is an example of a Span element associated with a set of elements. The same trick with attached properties helps bind Run to text.
The answer will also depend on the context of the use of the FlowDocument . If it is in read-only mode, BlockUIContainer and InlineUIContainer are your friends. But if the FlowDocument is inside the RichTextBox , you will hate and curse them (copy / paste problems, undo / redo, etc.) along with the entire WPF text support infrastructure.
Anvaka
source share