MindFusion.Wpf Pack Programmer's Guide
DiagramBase.DrawAnchorPoint Event
See Also
 





Raised when an anchor point must be custom drawn.

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

 Syntax

C#  Copy Code

public event EventHandler<DrawAnchorPointEventArgs> DrawAnchorPoint

Visual Basic  Copy Code

Public Event DrawAnchorPoint As EventHandler(Of DrawAnchorPointEventArgs)

 Event Data

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

Member name

Description

Node

A DiagramNode containing the anchor point that is being painted.

AnchorIndex

Index of the anchor point withing the node's AnchorPattern.

AnchorPattern

An AnchorPattern instance that contains the anchor point definition.

Location

A Point specifying the location of the anchor point.

Graphics

DrawingContext instance whose methods should be used to draw the anchor point mark.

 Remarks

DrawAnchorPoint is raised for an AnchorPoint if the point's MarkStyle is set to Custom.

 Example

The following example demonstrates how to draw images for anchor points:

C#  Copy Code

void diagram_DrawAnchorPoint(object sender, DrawAnchorPointEventArgs e)
{
    PointF imgPos = e.Location;
    imgPos.Y -= 1.8f;

    e.Graphics.DrawImage(icon, imgPos);
}

Visual Basic  Copy Code

Sub diagram_DrawAnchorPoint(ByVal sender As Object, ByVal e As DrawAnchorPointEventArgs) Handles diagram.DrawAnchorPoint

    Dim imgPos As PointF = e.Location
    imgPos.Y -= 1.8F

    e.Graphics.DrawImage(icon, imgPos)

End Sub

 See Also

DiagramBase Members
DiagramBase Class
MindFusion.Diagramming.Wpf Namespace