/// <summary> /// Gets the inlines which affect the typography of the TextBlock. /// </summary> private IEnumerable<(Inline inline, int start, int end)> GetEffectiveInlines() { if (UseInlinesFastPath) { yield break; } var start = 0; foreach (var inline in Inlines.SelectMany(InlineExtensions.Enumerate)) { if (inline.HasTypographicalEffectWithin(this)) { yield return (inline, start, start + inline.GetText().Length); } if (inline is Run || inline is LineBreak) { start += inline.GetText().Length; } } }