Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1285
Mouse Double Click
posted

Is it possible to capture where a user double clicks on a single node?

Thanks

Andrew

Parents
  • 34510
    Offline posted

    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.

Reply Children