Is it possible to clear all properties like (background color...) from Paragraph.Inline elements, just like you can do with class TextRange ?
Well, I wanted to clear background propery from previous Run element from Inline Collection. So I thought it would be easier to call a method which would clear all previous properties. However, in my case, it seems the only way to do this is something like this:
int index = 0;
...
List<Inline> runList = ParagraphComponent.Inlines.ToList();
if (index < runList.Count) {
if (index > 1) {
int previousPartIndex = index - 2;
if (!string.IsNullOrEmpty(runList[previousPartIndex].Text)) {
runList[previousPartIndex].Background = null;
}
}
runList[index].Background = BackgroundColor;
index += 2;
}