Docsv3.31.0
Back to API Reference
Class

LinkModifier

Marks text ranges as clickable hyperlinks and dispatches their click/hover events.

Remarks

Visual styling and state feedback are configured with ordinary modifiers and parameter changes in a CompositeModifier, as in the built-in Link preset. The primary parameter is the URL. Subscribe to LinkClicked to handle activation (a confirmed click / tap — raised from the interaction machine's Activated event), or let the modifier open the URL via OpenURL when AutoOpenUrl is set.

Example

csharp
public string Url{ get; set }

URL used when the source does not supply a primary value.

public bool AutoOpenUrl{ get; set }

Whether activation automatically opens the resolved URL.

protected override void OnApply(in RangeApplyContext context)

Adds the source range with its primary value and resolved interaction parameters.

protected override void HandleInteraction(RangeInteraction interaction)

Receives routed target events that public handlers have not marked as handled.

protected override void HandleDefaultAction(RangeInteraction interaction)

Performs built-in behavior after all capture, channel, modifier and bubble handlers. It is skipped when a handler calls RangeInteraction.PreventDefault.

public Action<string> LinkClicked

Occurs when a link has been clicked, providing the URL.

public Action<string> LinkEntered

Occurs when the pointer has entered a link, providing the URL.

public Action LinkExited

Occurs when the pointer has exited a link.

See Also