I think I understand the sequence of events a little better but I’m still not sure how to address the problem.
The problem begins when dragging nodes out of the SubGraph. I have lifted your SubGraphDraggingTool.vb from SubGraphApp and made it my dragging tool. Inside the DoDragging method, the following block of code is key:
If (Not sg Is Nothing) Then
’ adding to a subgraph
Else ’ adding at top-level
If (evttype = GoInputState.Finish) Then
Return ’ DoDragging already done
At the point where evttype = Finished is true, the next line of code executed is:
As it turns out, this line of code also initiates the OnParentChanged method inside my node class. But, because dragging out of the SubGraph has not yet completed, the Clear and AddRange methods have
not yet been called, I don’t believe the GoView.Document ‘sees’ the moved nodes yet. This is why FindNode fails to find the nodes.
What can I do about this ordering of events? Is there a way to delay firing the OnParentChanged event somehow until the complete highlighted block of code has executed? Is there another workaround?
Thanks for your help.