Class HyperlinkText

GoDiagram®
v10.0.12
by Northwoods Software®

A "HyperlinkText" is either a TextBlock or a Panel containing a TextBlock that when clicked opens a new browser window with a given or computed URL.

Inheritance
HyperlinkText
Namespace: Northwoods.Go.Extensions
Assembly: HyperlinkTextAvalonia.dll
Syntax
public class HyperlinkText
Remarks

When the user's mouse passes over a "HyperlinkText", the text is underlined. When the mouse hovers over a "HyperlinkText", it shows a tooltip that displays the URL.

This "HyperlinkText" builder is not pre-defined in the GoDiagram library, so you will need to load this definition.

Typical usages:

Builder.Make<GraphObject>("HyperlinkText", "https://godiagram.com", "Visit GoDiagram");

Builder.Make<GraphObject>("HyperlinkText",
  (n) => "https://godiagram.com/winforms/" + n.data.version,
  new Panel("Auto")
    .Add(
      new Shape { ... },
      new TextBlock { ... }
    )
);

Builder.Make<GraphObject>("HyperlinkText",
  (n) => "https://godiagram.com/winforms/" + n.data.version,
  (n) => "Visit GoDiagram version " + n.data.version
);

The first argument to the "HyperlinkText" builder should be either the URL string or a function that takes the data-bound Panel and returns the URL string. If the URL string is empty or if the function returns an empty string, the text will not be underlined on a mouse-over and a click has no effect.

The second argument to the "HyperlinkText" builder may be either a string to display in a TextBlock, or a function that takes the data-bound Panel and returns the string to display in a TextBlock. If no text string or function is provided, it assumes all of the arguments are used to define the visual tree for the "HyperlinkText", in the normal fashion for a Panel.

The result is either a TextBlock or a Panel.

Methods

Click(InputEvent, GraphObject)

Defines the platform-specific click handler for hyperlinks.

Declaration
public static void Click(InputEvent e, GraphObject obj)
Parameters
Type Name Description
InputEvent e
GraphObject obj

DefineBuilders()

Adds the "HyperlinkText" builder to the Builder.

Declaration
public static void DefineBuilders()