Raised just before a new AREA tag is added to the image map.
Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf
C# Copy Code |
---|
public event EventHandler<AreaEventArgs> CreatingArea |
Visual Basic Copy Code |
---|
Public Event CreatingArea As EventHandler(Of AreaEventArgs) |
CreatingArea event handlers receive an argument of type AreaEventArgs. The following AreaEventArgs members provide information relevant to the event:
Member name | Description |
---|---|
The HTML AREA tag created by HtmlBuilder. | |
The diagram element represented by AreaTag in the image map. | |
Contains the index of a column if the event is raised for a table cell. | |
Contains the index of a row if the event is raised for a table cell. |
You could handle this event in order to insert additional attributes or JavaScript event handlers into the AREA tag. The tag string already ends with a closing ">" when the event is raised, so you must insert any additional attributes one character before the end of the tag string.
The following code adds a JavaScript onClick event handler to the area tag:
C# Copy Code |
---|
void htb_CreatingArea(object sender, AreaEventArgs e) { string script = " onClick=\"alert('click click')\""; e.AreaTag = e.AreaTag.Insert(e.AreaTag.Length - 1, script); } |
Visual Basic Copy Code |
---|
Private Sub htb_CreatingArea(ByVal sender As Object, ByVal e As AreaEventArgs) Handles htb.CreatingArea |
WpfDiagram Programmer's Guide | © 2024 MindFusion |