Wpf richtextbox предотвратить отмену
Hello! I have a RichTextBox control. I use it for syntax highlighting in my text. The problem is: after a syntax is highlighted, when user press Ctrl+Z (calls Undo action)... control "unhighlights" my text. For highlighting I use Select method and SelectionColor property. How to suppress writting actions into the undo stack of a RichTextBox during SelectionColor changes? Is it possible?work.
Что я уже пробовал:
I tried using the LockCurrentUndoUnit method on the highlight logic to solve this problem, but it did not work.