I am trying to implement features similar to Visual Studio like code region expander/collapser for FlowDocument content. For this, I need to know, for instance, the Y coordinates of where exactly a paragraph begins and ends so that I can draw the adornments. How do I get this information?
Here's what I tried: I implemented an invisible "position tracker" UIElement, placed it at the beginning and end of the paragraph, and used its TranslatePoint method - but this isn't working. No matter what element I translate the coordinates with respect to, I always get {0,0} as the output.
What else can be done?