Provides support for using the mouse or touch to select text in the document viewer.
public class DocumentViewerSelectTextInteractiveMode : ImageViewerRubberBandInteractiveMode
Public Class DocumentViewerSelectTextInteractiveMode
ref class DocumentViewerSelectTextInteractiveMode : ImageViewerRubberBandInteractiveMode
This mode can be enabled using the InteractiveSelectText command.
The RenderSelection (true by default) is used to highlight the text selection on the view. Hence, when this mode is selecting and un-selecting text based on the user action, the view is updated to reflect the selection status. This performed "live" as the user clicks and drags on the view.
When the user clicks and draws the rubber band selection rectangle on a page that has text, hit-testing is performed to detect the characters that are included inside this rectangle. SetSelectedTextItems is called to add these characters to the current selection. This is performed "live" and the selection is updated as the user draws the selection rectangle and the view is updated instantly.
The values of LineKeyModifier, WordKeyModifier and CharacterKeyModifier control if the containing line or word of the character is also selected. By default, the values are set to None, Alt and Control respectively. This means when the user draws the selection rectangle without any modifiers, the whole line is selected when any of its characters is inside the rectangle. When Alt is pressed while the selection rectangle is draw; the whole word is selected when any of its characters is inside the rectangle and when Control is pressed; individual characters are selected without their containing words or lines.
This is the common behavior used by popular text editor applications. It can be changed by using the properties above or disable character/word selection all together by setting the values to None since LineKeyModifier is always checked first and any other modifier with the same value will be ignored.