StefanFFM
StefanFFM

Reputation: 1898

Text coloring based on the position of text

I'm using AvalonEdit to create a textview which formats text like this:

Col 1 - Col 5 : FontStyle1
Col 6 - Col 12: FontStyle2
etc.

I've done this by overriding the ColorizeLine-Method of DocumentColorizingTransformer and then calling ChangeLinePart(...) for each segment of the line. It works, but for a large number of lines (~10000) it takes a very long time (> 10 seconds) to initialize the textview.

Is there a more efficient way to do this?

Upvotes: 1

Views: 91

Answers (1)

StefanFFM
StefanFFM

Reputation: 1898

Setting ScrollViewer.CanContentScroll to true solved the issue.

Upvotes: 1

Related Questions