MindFusion.Wpf Pack Programmer's Guide
HtmlBuilder.CreatingArea Event
See Also
 





Raised just before a new AREA tag is added to the image map.

Namespace: MindFusion.Diagramming.Wpf
Assembly: MindFusion.Diagramming.Wpf

 Syntax

C#  Copy Code

public event EventHandler<AreaEventArgs> CreatingArea

Visual Basic  Copy Code

Public Event CreatingArea As EventHandler(Of AreaEventArgs)

 Event Data

CreatingArea event handlers receive an argument of type AreaEventArgs. The following AreaEventArgs members provide information relevant to the event:

Member name

Description

AreaTag

The HTML AREA tag created by HtmlBuilder.

Item

The diagram element represented by AreaTag in the image map.

Column

Contains the index of a column if the event is raised for a table cell.

Row

Contains the index of a row if the event is raised for a table cell.

 Remarks

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.

 Example

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

    Dim script As String = " onClick=" + Chr(34) + "alert('click click')" + Chr(34)
    e.AreaTag = e.AreaTag.Insert(e.AreaTag.Length - 1, script)

End Sub

 See Also

HtmlBuilder Members
HtmlBuilder Class
MindFusion.Diagramming.Wpf Namespace