TextPointer Class

Definition

Represents a position within a text element.

Equivalent WinUI class: Microsoft.UI.Xaml.Documents.TextPointer.

public ref class TextPointer sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class TextPointer final
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.WebHostHidden]
class TextPointer final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class TextPointer
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.WebHostHidden]
public sealed class TextPointer
Public NotInheritable Class TextPointer
Inheritance
TextPointer
Attributes

Windows 10 requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced in v1.0)

Properties

LogicalDirection

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

Equivalent WinUI property: Microsoft.UI.Xaml.Documents.TextPointer.LogicalDirection.

Offset

Gets the character index of a TextPointer within its container.

Equivalent WinUI property: Microsoft.UI.Xaml.Documents.TextPointer.Offset.

Parent

Gets the logical parent that contains the current position.

Equivalent WinUI property: Microsoft.UI.Xaml.Documents.TextPointer.Parent.

VisualParent

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

Equivalent WinUI property: Microsoft.UI.Xaml.Documents.TextPointer.VisualParent.

Methods

GetCharacterRect(LogicalDirection)

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

Equivalent WinUI method: Microsoft.UI.Xaml.Documents.TextPointer.GetCharacterRect.

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.

Equivalent WinUI method: Microsoft.UI.Xaml.Documents.TextPointer.GetPositionAtOffset.

Applies to