Text Selection

As mentioned previously, TextBlock optionally supports text selection. To enable it, you must set its IsTextSelectionEnabled property to true. When you do this, people using touch input can tap any word to highlight it, and then drag two circle adornments to change the range of the selection. With a mouse or pen, a caret is rendered instead of the typical mouse pointer, and users can do the typical selection gestures of dragging to define the selection range or double tapping to select an entire word. A right tap gesture on the TextBlock (which is press-and-hold for touch input) brings up a context menu with the choices of Copy (only if text is selected) and Select All, shown in Figure 12.11. The standard keyboard shortcuts of ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.