Hi again,
How would I detect whether the RichTextBox selection contains an InlineUIContainer?
The DocumentSelection classes don't seem to support this out of the box with something like the FlowDocument TextSelection.Contains(TextPointer) call and the InlineUIContainer doesn't have it's own position information (like InlineUIContainer.ContentStart and ContentEnd properties for FlowDocument classes).
It seems slightly strange that you can use a DocumentPosition to insert something in a document but the element itself doesn't retain some of that information for later comparison against the SelectionRange objects to determine what is in the selection.
Could you point me in the right direction to solve/workaround this?
Thanks!
How would I detect whether the RichTextBox selection contains an InlineUIContainer?
The DocumentSelection classes don't seem to support this out of the box with something like the FlowDocument TextSelection.Contains(TextPointer) call and the InlineUIContainer doesn't have it's own position information (like InlineUIContainer.ContentStart and ContentEnd properties for FlowDocument classes).
It seems slightly strange that you can use a DocumentPosition to insert something in a document but the element itself doesn't retain some of that information for later comparison against the SelectionRange objects to determine what is in the selection.
Could you point me in the right direction to solve/workaround this?
Thanks!