
I need to implement the behavior when a part of a text should be marked as an object. So the user can't delete or make other manipulations with the portion of this text - only the whole object.
I chose the ReadOnly Regions feature of SyntaxEditor. It allows me to create such regions of the text, but I can't delete them (or other operations). So, I created own classes to override the DeleteCommand and the BackspaceCommand to resolve the problem with deleting. In these classes I remove the read-only region and expand the selection before calling the base logic. This allows me to delete the whole text of this region.
But this action isn't restored by Undo command. So I have the problem with Undo command now. I mean, that Undo command doesn't restore the region.
Of course, there are other problems with these regions. For example, the problem with drag-n-drop operation..
Could you advise me more correct solution for my task or I should continue to customize other commands?
Thank you in advance.