Is it possible to capture where a user double clicks on a single node?
Thanks
Andrew
Hi Andrew,
Are you looking to catch a double click event or are you asking how to get the location of the mouse when the user double clicks on the node? If you want to catch a double click event in Silverlight you normally would have to write your own timing mechanism into the MouseLeftButtonDown event to determine if the click was a double click or not. In Silverlight 5 Microsoft added a new property in the MouseButtonEventArgs called ClickCount. If you are using Silverlight 5 then you can check if ClickCount is equal to 2. This means the user double clicked on the node. The code would look like this:
private void xamOrgChart1_NodeMouseLeftButtonDown(object sender, OrgChartNodeClickEventArgs e) { if (e.MouseEventArgs.ClickCount == 2) { // Do something } }
If you're looking for the position of the mouse when the user double clicks you would need to use the e.MouseEventArgs.GetPosition method and pass in the node that was double clicked to get the mouse position relative to the node. This position will tell you where in the node you double clicked.
Let me know if this is what you were looking for and if it helped you.
Hi Rob
This is exactly what I was looking for and luckily I am using Silverlight 5. Your code was a great help.
Many thanks for the speedy response.
Glad to help. Let me know if you have any further questions on this matter.