Hi Jason,
You need to hook the Document.EventSinkService.NodeMouseEnter event, because shapes are nodes that reside in the document scene tree. Because this event is a bubbling event, you need to filter the objects for which this event is raised:
document.EventSinkService.NodeMouseEnter += ...;
void OnNodeMouseEnter(NNodeViewEventArgs args)
{
if (args.Node is NShape == false)
return;
// the shape, which the mouse enters
NShape shape = args.Node as NShape;
}
In general if you want to hook a specific event for all nodes, you never need to iterate all nodes and subscribe for this event, because in the diagram they will all dispatch the event to the event sink service.
The previous sample will work regardless of the shapes in the diagram (e.g. you can add/remove shapes) and still will receive mouse enter for the current set of shapes in the drawing.
For more information take a look at this topic in the Users Guide:
Diagram for .NET > User's Guide > Conceptual Overview > Diagram Services
Best Regards,
Nevron Support Team