This topic covers the text editing capabilities of the xamSyntaxEditor™ control from both the developer and user’s perspective.
The following topics are prerequisites to understanding this topic:
This topic contains the following sections:
The xamSyntaxEditor is a highly customizable text editing control similar to Visual Studio’s code editor. There are a number of features included in the xamSyntaxEditor to facilitate document editing, by both the developer and the user. Some of the many features included are Clipboard Support; Undo and Redo; Find and Replace; Events and Commands among many others.
The xamSyntaxEditor displays a caret to show the insertion point in the document. That is the point where characters appear as they are typed. By default, the xamSyntaxEditor is set to Insert mode, which means that new characters inserted between the texts on either side of the caret, depending on the configuration of the FlowDirection property. This is done without overwriting the character at that position. Existing characters shift towards the end of the document. By setting the TextUpdateMode property to Overwrite forces the xamSyntaxEditor to overwrite the existing character(s) starting at the caret and replacing current character with the new one, one character at a time. To disable all editing, set the document’s IsReadOnly property to True .
By default, the xamSyntaxEditor’s caret moves to the right as characters are typed; however, you may reverse the direction by setting the FlowDirection
property to RightToLeft.
The xamSyntaxEditor control consists of one or two views into a document. Each of these views shows a portion of the document currently under edit. If the document is too larger to fit in the xamSyntaxEditor’s view, scrollbars will appear allowing the user to navigate the content of the document.
You can split the xamSyntaxEditor window (either horizontally or vertically) into two views allowing the user to quickly navigate and edit two parts of the same document at the same time. You can also limit user splitting to just horizontal or vertical via the SplitOptions property or disable splitting altogether via the same property. For more information, please see the Splitting topic.
The user can position the xamSyntaxEditor’s caret using either the keyboard or mouse. Also, using the various keyboard and mouse combinations, listed below, the user may select a continuous area of the text and perform various operations including, but not limited to, copy and delete. In addition, the user may start typing characters immediately after selecting an area of text, resulting in the newly typed text replacing the selected text. Optionally, you can configure notifications to notify you when a selection changes by either attaching a handler to the xamSyntaxEditor’s SelectionChanged event or manipulating the selection through the xamSyntaxEditor view’s SelectionManager.
The TextDocument has API methods to edit the content from code. Use the Append, Insert or Delete methods to perform the corresponding operation. Additionally, you may use the NewLineSequence property to specify which character(s) delimit the lines in the document.
This table catalogs the available keyboard key and key combinations available whenever you are editing a document’s content.
This table catalogs the available mouse movements, gestures and operation combinations available while editing the document’s content.
The following topics provide additional information related to this topic.