views:

25

answers:

0

I am working with a FlowDocument in a RichTextBox and I need to find a way of displaying the block hierarchy. I envisage using something like the WPF GroupBox whereby each block element is assigned a border and a non-editable identifying label. The borders will clearly show which block elements are contained within other elements and the labels are important because the document may contain a range of custom block element types, and it is essential to be able to distinguish these visually in the rendered outline.

Unfortunately, I don't have the first idea how to achieve this.

Since I don't want to apply any permanent formatting that would corrupt that of the document, I am looking for a technique that applies some kind of "adorner layer" to the document. But this is not possible because WPF adorners cannot be applied to FrameworkContentElement.

I realize this is a vague request, but I am hoping that it might provoke some interesting and varied solutions.

Thanks for your ideas,

Tim