TextPointer TextPointer TextPointer TextPointer Class

Definition

Represents a position within a text element.

public : sealed class TextPointer : ITextPointerpublic sealed class TextPointer : ITextPointerPublic NotInheritable Class TextPointer Implements ITextPointer// This API is not available in Javascript.
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Properties

LogicalDirection LogicalDirection LogicalDirection LogicalDirection

Gets the logical direction associated with the current position, which is used to disambiguate content associated with the current position.

public : LogicalDirection LogicalDirection { get; }public LogicalDirection LogicalDirection { get; }Public ReadOnly Property LogicalDirection As LogicalDirection// This API is not available in Javascript.
Value
LogicalDirection LogicalDirection LogicalDirection LogicalDirection

The LogicalDirection value that is associated with the current position.

Offset Offset Offset Offset

Gets the character index of a TextPointer within its container.

public : int Offset { get; }public int Offset { get; }Public ReadOnly Property Offset As int// This API is not available in Javascript.
Value
int int int int

The character index of a TextPointer within its container.

Parent Parent Parent Parent

Gets the logical parent that contains the current position.

public : DependencyObject Parent { get; }public DependencyObject Parent { get; }Public ReadOnly Property Parent As DependencyObject// This API is not available in Javascript.
Value
DependencyObject DependencyObject DependencyObject DependencyObject

The logical parent that contains the current position. Can return the RichEditBox when at the top of the content stack.

VisualParent VisualParent VisualParent VisualParent

Gets the user interface (UI) element that "owns" this TextPointer.

public : FrameworkElement VisualParent { get; }public FrameworkElement VisualParent { get; }Public ReadOnly Property VisualParent As FrameworkElement// This API is not available in Javascript.

Methods

GetCharacterRect(LogicalDirection) GetCharacterRect(LogicalDirection) GetCharacterRect(LogicalDirection) GetCharacterRect(LogicalDirection)

Returns a bounding box for content that borders the current TextPointer in the specified logical direction.

public : Rect GetCharacterRect(LogicalDirection direction)public Rect GetCharacterRect(LogicalDirection direction)Public Function GetCharacterRect(direction As LogicalDirection) As Rect// This API is not available in Javascript.
Parameters
direction
LogicalDirection LogicalDirection LogicalDirection LogicalDirection

One of the LogicalDirection values that specifies the logical direction in which to find a content bounding box.

Returns

A Rect for content that borders the current TextPointer in the specified direction, or a Rect that evaluates as Empty if current and valid layout information is unavailable.

GetPositionAtOffset(Int32, LogicalDirection) GetPositionAtOffset(Int32, LogicalDirection) GetPositionAtOffset(Int32, LogicalDirection) GetPositionAtOffset(Int32, LogicalDirection)

Returns a TextPointer to the position indicated by the specified offset, in symbols, from the beginning of the current TextPointer and in the specified direction.

public : TextPointer GetPositionAtOffset(int offset, LogicalDirection direction)public TextPointer GetPositionAtOffset(Int32 offset, LogicalDirection direction)Public Function GetPositionAtOffset(offset As Int32, direction As LogicalDirection) As TextPointer// This API is not available in Javascript.
Parameters
offset
int Int32 Int32 Int32

An offset, in symbols, for which to calculate and return the position. If the offset is negative, the returned TextPointer precedes the current TextPointer; otherwise, it follows.

direction
LogicalDirection LogicalDirection LogicalDirection LogicalDirection

One of the LogicalDirection values that specifies the logical direction of the returned TextPointer.

Returns

A TextPointer to the position indicated by the specified offset and in the direction specified by the direction parameter, or null if the offset extends past the end of the content.