When doing some testing I noticed that the Click and AfterActivate events fire once for every node in the tree, but for the same node. So for example I have the following nodes:
Node 1
Node2
Node3
When I click 'Node 1' I get the AfterActivate event fired 3 times for node 1. Why is this? Shouldn't they just be fired once as the node is clicked and activated?I thought maybe my code was re-activating it redundently, but the call stack didn't show my code triggering any of the activations.This results in me having to put code in to check if it has been already activated...inside the activated event...
This was a mistake. It was because the events were being subscribed to once for every node in the tree. Sorry for wasting your time.
AfterActivate should only fire once when the node is activated. Unless, for some reason, the node is being activated, then deactivated, then re-activated, etc.