Ok, I'm trying to add a "custom property" to a piece of text in a RichTextBox control. I thought it would be easy, but apparently not :-)
The basic functionality I want is to be able to set a property on a particular word and be able to detect, when a word is double clicked, if that property is there or not.
My intial approach was to create a new DP and apply it to the text, but TextRange isn't actually a DependencyObject and Reflector shows it only accepts certain DPs that it maps directly to "real" properties.
Unfortunately I can't seem to find any other "hook" to let me do this. I can't inherit from any of the things that I CAN apply to text, as everything I need is either sealed, or contains internal abstracts, so I'm at a bit of a loss.
I could just keep track of ranges that have the property externally, and update that as the text is updated, but that sounds pretty horrible, and I really don't want to have to create my own RichTextBox just for this one feature!
Any suggestions would be most welcome :-)