Live Navigation API
Understand document navigation
Click a link in the RTF handbook or use the live map below. The inspector exposes the targets and links stored in the current document and shows how they relate.
Document modelLink → target
0 targets · 0 links
Visible link textDocumentLink
Named positionDocumentTarget
At the caret
Regular document text
Move the caret into a link or destination.
Named destinations
Click a destination to move the editor to its current position.
Internal links
The right side shows the target referenced by each link.
Build a navigation route
Create a destination first, then insert a link that points to it.
2
Insert the linkChoose where the new link should lead.
Ready to tryUse the controls above to interact with this demo.
What this demonstrates
Links and destinations are separate document objects
A DocumentTarget names a position in the document. A DocumentLink stores visible text and references one target, while a HypertextLink points outside the document.
Destinations
TXTextControl.documentTargets
Internal links
TXTextControl.documentLinks
External links
TXTextControl.hypertextLinks
Navigation event
documentLinkClicked
How it works
The RTF contains standard bookmarks and hyperlink fields. After the document is loaded, DocumentTargetCollection.forEach and DocumentLinkCollection.forEach build the live inspector from the document itself.
A clicked link provides static event information. The handler compares its start position with each live DocumentLink, calls getDocumentTarget on the matching object, and then calls DocumentTarget.scrollTo. This is the explicit navigation behavior used by the reference sample.
DocumentTargetCollection.add creates a named destination at the caret. DocumentLinkCollection.add inserts visible text connected to an existing target. The inspector refreshes after either operation so the new relationship is immediately visible.
External URLs belong to HypertextLinkCollection and raise hypertextLinkClicked. Keeping internal and external links separate lets the host application scroll within the editor or open a browser location as appropriate.
NuGet packages
TXTextControl.TextControl.Core.SDK
34.0.4
Provides the core document model and server-side document processing APIs.
dotnet add package TXTextControl.TextControl.Core.SDK --version 34.0.4
Provides the browser-based TX Text Control document editor and JavaScript API.
dotnet add package TXTextControl.Web --version 34.4.0
TXTextControl.Web.DocumentEditor.Backend
34.4.0
Hosts the WebSocket-based backend used by the browser document editor.
dotnet add package TXTextControl.Web.DocumentEditor.Backend --version 34.4.0