How Can I Get a TextPointer from a mouse click in a FlowDocument
- by Bear
I would like to get the word that a user has clicked on in a FlowDocument.
I am currently adding an event handler to every Run in the document and iterating through the TextPointers in the Run that was clicked, calling GetCharacterRect() on each one and checking if the rectangle contains the point.
However, when the click occurs near the end of a long Run this takes 10 seconds.
Is there any more efficient method?