Hi. I got a problem with this event. My objective is when i enter the mouse in a GoIconicNode, the informations about what that node represents is viewed by the user. But if i pass the mouse in a GoLink the program go to an exception.
How can i validate (if is a GoIconicNode or a GoLink) the object that the mouse enter?
The GoObjectEnterLeaveEventArgs.From and .To properties refer to the GoObjects that the mouse was in and now is in. These may also be null, if the mouse had been over the background or is now over the background.
These can also be GoObjects of any type, so you need to check the type to see if it is what you care about. That includes the children of a node, too, so you will probably want to look at the ParentNode to see if it's a GoIconicNode in your application.
An example is the goView1_ObjectEnterLeave event handler in IconicApp.
It is also common to implement a GoObject.OnEnterLeave method override. This has the advantage that you could override this method on your GoIconicNode-inheriting class (if you have one) and won't need to check for null, don't need to walk the Parent tree, or check for any particular node type. This is because the "EnterLeave" event is bubbled up the Parent chain from the original GoObjects. There are lots of examples of this method override in the sample applications.