Version

Drag and Drop Support (xamSyntaxEditor)

Topic Overview

Purpose

This topic will describe how to use drag and drop operations to move text both inside and outside of the xamSyntaxEditor™ .

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 covers the text editing capabilities of the xamSyntaxEditor control from both the developer and user’s perspective.

Introduction

Description

The xamSyntaxEditor supports both internal (within the document) and external (between applications) text selection drag and drop.

Note
Note

Due to limitations in Silverlight, the xamSyntaxEditor does not support dragging to a drop target that is external to the control or dropped on from an external source.

Dragging selection

When moving the mouse over a text selection, the mouse cursor shows if the selection supports dragging. An arrow mouse pointer means that the selection supports dragging while an I-Beam mouse pointer means that the text selection does not support dragging.

This table shows the mouse cursors and their meaning:

Mouse Cursor Meaning
xamSyntaxEditor DND 1.png

You cannot drag the selected text.

xamSyntaxEditor DND 0.png

You can drag the selected text.

Dropping selection

When dragging a selection, the mouse pointer shows whether it is possible to drop the selection at the current mouse position. The default drag operation will move the text selection to the new place; however, if the user presses the CTRL key, a “+” sign appears in the mouse cursor indicating that the drag operation will copy the text selection leaving the current text selection intact.

This table shows the mouse cursors and their meaning:

Mouse Cursor Meaning
xamSyntaxEditor DND 2.png

You cannot drop the selected text.

xamSyntaxEditor DND 3.png

You can move the selected text selection here.

xamSyntaxEditor DND 4.png

You can copy the text selection here.

Drag and Drop Configuration Summary

Drag and drop configuration summary chart

The following table lists the properties used to restrict dragging or dropping operations.

Configurable Aspect Details Properties

Allow dragging

Toggles dragging selected text on and off.

Allow dropping

Toggles dropping selected text on and off.

Events Summary

Events summary chart

The following table lists the events fired by the xamSyntaxEditor during the drag and drop operations.

Event Event Handler Argument and Properties Description

This event fires when the drag operation begins. The event handler argument exposes:

  • Cancel property to cancel the dragging operation

  • DataObject property, which exposes methods for changing the data to be dragged

This event fires when the user releases the mouse button over a valid drop location. The event handler argument exposes:

  • Cancel property to cancel the dropping operation

  • DataObject property, which exposes methods for changing the data to be dropped

Related Content

Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic lists the events and supported commands available to you, while building your xamSyntaxEditor applications.