Example for NShowHideSubtree Decorator Click Event


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

By Jaideep Tandon - 10 Years Ago
Hello All,

I am new in this tool
therefore can any one please suggest me

How to call decorator click event?


Thanks
By Nevron Support - 10 Years Ago

Hi,

It is unclear from your question what are you trying to do. If you want to expand/collapse a toggle decorator (i.e. an expand/collapse decorator or a show/hide subtree decorator), you should call its ToggleState method.

If you want to subscribe to the click event of the decorator, you should use the NodeClick event of the drawing document's Event Sink service. Here's some sample code:

document.EventSinkService.NodeClick += OnNodeClick; 

...

 

private void OnNodeClick(NNodeViewEventArgs args)

{

      NShowHideSubtreeDecorator decorator = args.Node as NShowHideSubtreeDecorator;

      if (decorator != null)

      {

            // Your code here

            args.Handled = true;

      }

}

By Jaideep Tandon - 10 Years Ago
Hi,
I used your code But It not go to that method OnNodeClick when i click on decorator.

Currently i am using NDrawingView1_AsyncClick method to detect decorator. but this method called each time wen you click on image

But I want a method called only when i click on decorator.

Thanks