Version

Editing Support Overview (xamSyntaxEditor)

Topic Overview

Purpose

This topic covers the text editing capabilities of the xamSyntaxEditor™ control from both the developer and user’s perspective.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this topic, you will find information to help you better understand the xamSyntaxEditor’s functions.

This topic provides you with systematic instructions designed to help you get the xamSyntaxEditor up and running as quickly as possible.

Introduction

Introduction to the xamSyntaxEditor editing support

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.

Note
Note

The scrollbars move the visible part of the document’s content in the view while maintaining the caret’s position during scrolling.

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.

Keyboard Shortcuts

Overview

This table catalogs the available keyboard key and key combinations available whenever you are editing a document’s content.

Caret shortcuts

In order to: Use this keyboard key:

Move up

Up arrow

Move down

Down arrow

Move left

Left arrow

Move right

Right arrow

Move to begin of line / begin of text

Home

Move to end of line

End

Move to begin of document

Ctrl + Home

Move to end of document

Ctrl + End

Move one page up (this will scroll the document if necessary to persist the caret in the visible area)

Page up

Move one page down (this will scroll the document if necessary to persist the caret in the visible area)

Page down

Text editing

In order to: Use this keyboard key:

Delete current character /

Delete selected text

Delete

Delete previous character

Backspace

Switch between Insert and Overwrite mode

Insert

Scrolling shortcuts

In order to: Use this keyboard key:

Scroll document up (without moving the caret position)

Ctrl + Up arrow

Scroll document down (without moving the caret position)

Ctrl + Down arrow

Selection shortcuts

In order to: Use this keyboard key:

Select one character left

Shift + Left arrow

Select one character right

Shift + Right arrow

Select one word left

Ctrl + Shift + Left arrow

Select one word right

Ctrl + Shift + Right arrow

Select one line upwards

Shift + Up arrow

Select one line downwards

Shift + Down arrow

Select to the beginning of the line

Shift + Home

Select to the end of the line

Shift + End

Select one page upwards

Shift + page up

Select one page downwards

Shift + page down

Select the whole document content

Ctrl + A

Clipboard shortcuts

In order to: Use this keyboard key:

Cut

Ctrl + X

Shift + Delete

Copy

Ctrl + C

Ctrl + Insert

Paste

Ctrl + V

Shift + Insert

Undo/Redo shortcuts

In order to: Use this keyboard key:

Undo

Ctrl + Z

Alt + Backspace

Redo

Ctrl + Y

Ctrl + Shift + Z

Mouse Shortcuts

Overview

This table catalogs the available mouse movements, gestures and operation combinations available while editing the document’s content.

Caret shortcuts

In order to: Use these mouse actions or movements:

Position the caret

Place the caret at the desired location and Click the left mouse button

Scrolling shortcuts

In order to: Use these mouse actions or movements:

Scroll document up (without moving the caret position)

Rotate mouse wheel up

Scroll document down (without moving the caret position)

Rotate mouse wheel down

Selection shortcuts

In order to select: Use these mouse actions or movements:

Text

Click left mouse button and begin dragging at the desired direction

Word

Double click on the desired word

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

In this topic, you will find instructions and code examples for using the xamSyntaxEditor `TextDocument’s Load and Save methods for loading and saving content.

This topic provides information about text colorization, based on the TextDocument’s associated language.

The topics in this group explain the ways to customize the xamSyntaxEditor .

This topic provides information on how to change the presention of the document’s content inside the xamSyntaxEditor .

This topic will help you understand the document splitting capability of the xamSyntaxEditor and how to customize it.