What is a robust way of making certain lines readonly in an AvalonEdit control? Users are allowed to change certain method bodies in a C# or VB template file but nothing else. The readonly state per line needs to be kept intact when users add or remove lines, i.e. the readonly blocks below the edited content need to shift up and down accordingly.
I'm using AvalonEdit in a WPFHost on winforms.