HyperlinkExtensions
Namespace: Hex1b
Assembly: Hex1b.dll
Extension methods for creating and configuring instances using the fluent API.
public static class HyperlinkExtensionsInheritance
Object → HyperlinkExtensions
Methods
Ellipsis(HyperlinkWidget)
Sets the text overflow behavior to . Text is truncated with "..." when it exceeds the available width.
Parameters:
widget(HyperlinkWidget): The hyperlink widget to configure.
Returns: HyperlinkWidget
A new with Ellipsis overflow behavior.
public static HyperlinkWidget Ellipsis(this HyperlinkWidget widget)Hyperlink<TParent>(WidgetContext<TParent>, string, string, Action<HyperlinkClickedEventArgs>)
Creates a with the specified text, URI, and click handler.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.text(String): The visible text to display.uri(String): The URI to link to when clicked.onClick(Action<HyperlinkClickedEventArgs>): The click handler to invoke when the hyperlink is activated.
Returns: HyperlinkWidget
A new configured with the click handler.
public static HyperlinkWidget Hyperlink<TParent>(this WidgetContext<TParent> ctx, string text, string uri, Action<HyperlinkClickedEventArgs> onClick) where TParent : Hex1bWidgetHyperlink<TParent>(WidgetContext<TParent>, string, string, Func<HyperlinkClickedEventArgs, Task>)
Creates a with the specified text, URI, and async click handler.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.text(String): The visible text to display.uri(String): The URI to link to when clicked.onClick(Func<HyperlinkClickedEventArgs, Task>): The async click handler to invoke when the hyperlink is activated.
Returns: HyperlinkWidget
A new configured with the async click handler.
public static HyperlinkWidget Hyperlink<TParent>(this WidgetContext<TParent> ctx, string text, string uri, Func<HyperlinkClickedEventArgs, Task> onClick) where TParent : Hex1bWidgetHyperlink<TParent>(WidgetContext<TParent>, string, string)
Creates a with the specified text and URI.
Parameters:
ctx(WidgetContext<<TParent>>): The widget context.text(String): The visible text to display.uri(String): The URI to link to when clicked.
Returns: HyperlinkWidget
A new with default overflow behavior (Truncate).
public static HyperlinkWidget Hyperlink<TParent>(this WidgetContext<TParent> ctx, string text, string uri) where TParent : Hex1bWidgetTruncate(HyperlinkWidget)
Sets the text overflow behavior to . Text is clipped by parent containers with no visual indicator.
Parameters:
widget(HyperlinkWidget): The hyperlink widget to configure.
Returns: HyperlinkWidget
A new with Truncate overflow behavior.
public static HyperlinkWidget Truncate(this HyperlinkWidget widget)Wrap(HyperlinkWidget)
Sets the text overflow behavior to . Text wraps to multiple lines at word boundaries.
Parameters:
widget(HyperlinkWidget): The hyperlink widget to configure.
Returns: HyperlinkWidget
A new with Wrap overflow behavior.
public static HyperlinkWidget Wrap(this HyperlinkWidget widget)Remarks
These methods enable concise hyperlink widget creation within widget builder callbacks. The returned can be further configured with overflow methods like and , click handlers, or size hints.
Examples
Using Hyperlink within a VStack:
ctx.VStack(v => [
v.Hyperlink("Click here", "https://example.com"),
v.Hyperlink("Long link text that wraps", "https://example.com").Wrap()
])