Method InRun
InRun(TextRun, int)
Creates a position before character offset of a text run, in the
paragraph that holds it (directly or inside an inline content control).
public static DocumentPosition InRun(TextRun run, int offset)
Parameters
runTextRunThe run.
offsetintThe character offset in the run, from 0 to its length. For a run a reader synthesized, which counts as one, 0 is before it and anything else after.
Returns
- DocumentPosition
The position.
Exceptions
- ArgumentNullException
runis null.- ArgumentOutOfRangeException
offsetis outside the run's text.- ArgumentException
The run is not in a paragraph, or is part of a field's code, which text editing does not address.