Is there an easy way to call SyntaxEditor.EditorCommands from code xaml.cs file?

SyntaxEditor for WPF Forum

Posted 4 years ago by JP Garza
Version: 19.1.0685
Avatar

Since my SyntaxEditor is created dynamically as datatemplate I am trying to find a way to call all this syntax editor commands on the code behind (xaml.cs) file. I am able to find my syntax editor using the VisualTreeHelperExtended class, but once I have my active editor is there away to call (for example) Undo or Redo on it? Are they all accesible inside the SyntaxEditor object?

[Modified 4 years ago]

Comments (1)

Answer - Posted 4 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

All of the commands have related API members you can call.  For instance, undo is:

editor.Document.UndoHistory.Undo();

A lot of common text change commands are available like:

editor.ActiveView.TextChangeActions.CommentLines();

I hope that helps.


Actipro Software Support

The latest build of this product (v24.1.2) was released 1 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.