As far as I know, no. My suggestion is that for this purpose you create your own GetPositionAtOffset method. You can check which PointerContext is in the TextPointer using:
TextPointer.GetPointerContext(LogicalDirection);
To get the following TextPointer that points to another PointerContext:
TextPointer.GetNextContextPosition(LogicalDirection);
The sample code I used in a recent project ensures that the context of the pointer is of type Text by looping until it is found. You can use this in your implementation and skip the offset increment if it is found:
// for a TextPointer start while (start.GetPointerContext(LogicalDirection.Forward) != TextPointerContext.Text) { start = start.GetNextContextPosition(LogicalDirection.Forward); if (start == null) return; }
I hope you can use this information.
source share