I need to handle custom XML tags inside a RichTextBox and have them display their text adorned with a glyph such as can be done in Adobe InDesign Story Board Editor. My first thought is to subclass a Span control and create a custom control that can then act like a Italic or Bold but display my custom presentation. I need to allow these custom tags to act like XAML inside the Rtb and hide the details of the underlying custom XML tag from the users. Can this be done with WPF? And if so what is the right approach? Is the kind of situation where a custom control should be used?
Here is an example of what I mean. Note how the Xml tag "Paper000_Paragraph002" is represented graphically. I would like to create a custom control that could do the same that would work inside a RichTextBox, for example like the <em> tag in paragraph 6.