How to capture click event on composite shape elements e.g. Text Primitives?


https://www.nevron.com/Forum/Topic11838.aspx
Print Topic | Close Window

By Niranjan Singh - 8 Years Ago
Hi,
  • Is there any way to create hyperlink label in the shape library document.
  • Can i hot track shape element? for example in attached image, a text primitive which automatically create when we group shape elements.
  • Can we capture in any event that shape element is clicked but we can capture shape click event as specified in the article - Capture the event when a user clicks on a node in a flowchart
Is there any work around to implement this functionality?? 

See attached image create from Library document and I want to convert a specific text primitive in hyperlink and that help me to do some operation on double click or click..

Thanks,
Niranjan 
By Nevron Support - 8 Years Ago
Hi,

You should subscribe to the NodeMouseDown event of the drawing document's event sink service:

document.EventSinkService.NodeMouseDown += OnEventSinkServiceNodeMouseDown;


This is a bubbling event that starts at the hit node (which is usually a diagram primitive) and bubbles up to the drawing document. The argument passed to the event handler contains a property Button for detecting the used mouse button and properties HitNode and Node that indicate the clicked node and the current node. When the event is bubbling up, the event handler is called multiple times and the Node property is changed on each call, but the HitNode stays the same.

In the event handler if the Node is the one you are interested in, then you should take the proper action, for example to open a web page in the default web browser in your case.
By Niranjan Singh - 8 Years Ago
Hi,

Thanks for the detailed information. I am using Diagram control in Winforms application. Is this event work same as you told in Windows application also??

Thanks,
Niranjan
By Nevron Support - 8 Years Ago
Hi Niranjan,

If by "Windows application" you mean a WPF application, then yes, you can use the same event to handle Nevron Diagram node mouse down events. You can integrate Nevron Diagram for .NET in a WPF application using the WinFormControlHost.