menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class HyperlinkSettings - Blazor API Reference | Syncfusion

    Show / Hide Table of Contents

    Class HyperlinkSettings

    Represents settings for configuring hyperlink properties in SfDiagramComponent annotations.

    Inheritance
    System.Object
    DiagramObject
    HyperlinkSettings
    Implements
    IDiagramObject
    System.ICloneable
    Inherited Members
    DiagramObject.GetParent()
    DiagramObject.OnPropertyChanged(String, Object, Object, IDiagramObject)
    Namespace: Syncfusion.Blazor.Diagram
    Assembly: Syncfusion.Blazor.dll
    Syntax
    public class HyperlinkSettings : DiagramObject, IDiagramObject, ICloneable
    Remarks

    The HyperlinkSettings class enables you to create interactive hyperlinks within diagram annotations that can navigate to external web pages or internal resources. Hyperlinks can be applied to both node and connector annotations to enhance diagram interactivity.

    Examples

    This example demonstrates how to create a node with a hyperlink annotation:

    Node node = new Node()
    {
        OffsetX = 250,
        OffsetY = 250,
        Width = 100,
        Height = 100,
        // Initialize annotation collection
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            // Add text as hyperlink.
            new ShapeAnnotation { Hyperlink = new Hyperlink{ Content = "Syncfusion", Link = "https://www.syncfusion.com" } }
        },
    };

    Constructors

    HyperlinkSettings()

    Initializes a new instance of the Hyperlink.

    Declaration
    public HyperlinkSettings()

    HyperlinkSettings(HyperlinkSettings)

    Initializes a new instance of the HyperlinkSettings class by copying values from an existing HyperlinkSettings instance.

    Declaration
    public HyperlinkSettings(HyperlinkSettings src)
    Parameters
    Type Name Description
    HyperlinkSettings src

    The source HyperlinkSettings instance to copy from.

    Properties

    Color

    Gets or sets the fill color of the hyperlink in the HyperlinkSettings.

    Declaration
    public string Color { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the color value for the hyperlink text. The default value is null.

    Remarks

    The color property allows customization of hyperlink appearance by specifying the text color.

    When set to null, the hyperlink will use the default color scheme of the parent annotation.

    Supported color formats include named colors (e.g., "Red", "Blue"), hexadecimal values (e.g., "#FF0000"), and RGB values.

    Examples

    The following example demonstrates how to set the hyperlink color in a diagram annotation:

    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            // Add text as hyperlink.
            new ShapeAnnotation { Hyperlink = new Hyperlink{ Color = "Red", Link = "https://www.syncfusion.com" } }
        },
    };

    Content

    Gets or sets the content of the hyperlink in the HyperlinkSettings.

    Declaration
    public string Content { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the display text for the hyperlink. The default value is null.

    Remarks

    The content property defines the visible text that users will see and can click to navigate to the specified hyperlink.

    When set to null or empty, the hyperlink may not be visible or clickable in the annotation.

    Examples

    The following example demonstrates how to set hyperlink content in a diagram annotation:

    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            // Add text as hyperlink.
            new ShapeAnnotation { Hyperlink = new Hyperlink{ Content = "Syncfusion", Link = "https://www.syncfusion.com" } }
        },
    };

    TextDecoration

    Gets or sets the text decoration style for the hyperlink content in the HyperlinkSettings.

    Declaration
    public TextDecoration TextDecoration { get; set; }
    Property Value
    Type Description
    TextDecoration

    A TextDecoration specifying the visual decoration applied to the hyperlink text. The default value is None.

    Remarks

    The TextDecoration property defines the visual styling applied to hyperlink text in diagram annotations, allowing you to add visual emphasis such as underlines, overlines, or strikethrough effects.

    • None - Represents the default appearance of text without any decoration
    • Overline - Draws a horizontal line above the text
    • Underline - Draws a horizontal line under the text
    • LineThrough - Draws a horizontal line through the text
    Examples

    The following example demonstrates how to set text decoration for a hyperlink in a diagram annotation:

    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            // Add text as hyperlink.
            new ShapeAnnotation { Hyperlink = new Hyperlink{  TextDecoration = TextDecoration.None, Content = "Syncfusion", Link = "https://www.syncfusion.com" } }
        },
    };

    Url

    Gets or sets the URL link for the hyperlink in the HyperlinkSettings.

    Declaration
    public string Url { get; set; }
    Property Value
    Type Description
    System.String

    A System.String representing the target URL for the hyperlink navigation. The default value is null.

    Remarks

    The Url property defines the destination link that users will navigate to when clicking the hyperlink in diagram annotations.

    When set to null or empty, the hyperlink will not perform any navigation action when clicked.

    Examples

    The following example demonstrates how to set a hyperlink URL in a diagram annotation:

    Node node = new Node()
    {
        Annotations = new DiagramObjectCollection<ShapeAnnotation>() 
        { 
            // Add text as hyperlink.
               new ShapeAnnotation { Hyperlink = new Hyperlink{ Link = "https://www.syncfusion.com" } }
        },
    };

    Methods

    Clone()

    Creates a new HyperlinkSettings instance that is a copy of the current hyperlink settings.

    Declaration
    public override object Clone()
    Returns
    Type Description
    System.Object

    A new HyperlinkSettings object that is a deep copy of the current instance, containing identical property values.

    Overrides
    DiagramObject.Clone()

    Implements

    IDiagramObject
    System.ICloneable
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved