ElementClickEventArgs
Namespace: Wisej.Web.Ext.Mermaid
Assembly: Wisej.Web.Ext.Mermaid (4.1.0.0)
Provides data for the ElementClick event of the Mermaid control.
- C#
- VB.NET
public class ElementClickEventArgs : MouseEventArgs
Public Class ElementClickEventArgs
Inherits MouseEventArgs
Properties
Data
Object: Returns additional data about the clicked element.
This dynamic object may contain properties like:
tagName- The HTML tag name of the clicked elementtext- Text content of the elementid- Element IDdataId- Mermaid's data-id attributeclassName- CSS class nameselementType- Type of Mermaid element (node, edge, cluster, etc.)parentId- Parent element's IDparentDataId- Parent element's data-idariaLabel- Aria label (useful for edges)
The object also contains the raw button, x and y values sent by the browser. Fields that are not available are null or missing.
Example:
Navigating to the details of the clicked node:
private void mermaid1_ElementClick(object sender, ElementClickEventArgs e)
{
string type = e.Data?.elementType;
if (type != null && type.StartsWith("node"))
ShowDetails(e.Element, (string)e.Data.parentId);
}
Element
String: Returns the text of the element in the Mermaid diagram that was clicked by the user.
This is the trimmed text content of the clicked element or, when it has no text, of its parent Mermaid node, edge or cluster. The event is not fired for elements without any text.
Used By
| Name | Description |
|---|---|
| ElementClickEventHandler | Represents the method that will handle the ElementClick event in a Mermaid control. |