Class TextSelection
Represents text selection.
Inheritance
Inherited Members
Namespace: Telerik.Windows.Documents.Fixed.Selection
Assembly: Telerik.Windows.Documents.Fixed.dll
Syntax
public class TextSelection
Properties
EndPosition
Gets the end position of the selection.
Declaration
public TextPosition EndPosition { get; }
Property Value
TextPosition
The end position. |
IsEmpty
Gets a value indicating whether the selection is empty (contains no text).
Declaration
public bool IsEmpty { get; }
Property Value
System.Boolean
|
StartPosition
Gets the start position of the selection.
Declaration
public TextPosition StartPosition { get; }
Property Value
TextPosition
The start position. |
Methods
Clear()
Clears the selection.
Declaration
public void Clear()
GetSelectedText()
Gets the selected text.
Declaration
public string GetSelectedText()
Returns
System.String
A string containing the text content within the current selection, or an empty string if no text is selected. |
GetSelectedTextAsync()
Gets the selected text asynchronously.
Declaration
public Task<string> GetSelectedTextAsync()
Returns
System.Threading.Tasks.Task<System.String>
A task that represents the asynchronous operation. The task result contains the text content within the current selection. |
GetSelectionGeometry(RadFixedPage)
Gets the path geometry representing the visual bounds of the text selection on the specified page.
Declaration
public PathGeometry GetSelectionGeometry(RadFixedPage page)
Parameters
RadFixedPage
page
The page for which to retrieve the selection geometry. |
Returns
System.Windows.Media.PathGeometry
A PathGeometry object representing the visual bounds of the text selection on the specified page. |
Remarks
The geometry can be used for highlighting or other visual representations of the selected text.
SelectAll()
Selects the whole document.
Declaration
public void SelectAll()
SetSelection(TextPosition, TextPosition)
Sets the selection.
Declaration
public void SetSelection(TextPosition startPosition, TextPosition endPosition)
Parameters
TextPosition
startPosition
The start position. |
TextPosition
endPosition
The end position. |
SetSelectionEnd(TextPosition)
Sets the selection end.
Declaration
public void SetSelectionEnd(TextPosition endPosition)
Parameters
TextPosition
endPosition
The end position. |
SetSelectionStart(TextPosition)
Sets the selection start.
Declaration
public void SetSelectionStart(TextPosition startPosition)
Parameters
TextPosition
startPosition
The start position. |
ToString()
Returns a string that represents the current object.
Declaration
public override string ToString()
Returns
System.String
A string that represents the current object. |
Overrides
Events
SelectionChanged
Occurs when selection is changed.
Declaration
public event EventHandler SelectionChanged
Event Type
System.EventHandler
|
SelectionChanging
Occurs when selection is changing.
Declaration
public event EventHandler SelectionChanging
Event Type
System.EventHandler
|