Best way to implement a Parsing/Editable Richtextbox in WPF

Posted by lozzar on Stack Overflow See other posts from Stack Overflow or by lozzar
Published on 2010-03-13T00:58:27Z Indexed on 2010/03/13 1:07 UTC
Read the original article Hit count: 493

Filed under:
|
|
|

I'm trying to implement (as a prototype initially), a richtextbox control which can be parsed in real time to apply certain formatting options to it. This is being done in WPF so I thought the best way to go about it would be to extend the existing rich text box control.

I've run into the issue where it isn't documented well and the examples are quite slow (the ones I found have parse the whole document on every keystroke).

The way I've currently decided to go about it is to create a custom Inline element which can hold the formatting tags, and the contents. Hence I only have to parse the current paragraph and the runs in that paragraph for formatting tags.

Is there a better way to achieve this? Note this isn't for code/syntax based documents (so AvalonEdit isn't appropriate).

Cheers

© Stack Overflow or respective owner

Related posts about wpf

Related posts about richtextbox