We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

TooDeactivate event not getting fired

I am trying to handle the ToolDeactivate event for the diagram controller. If I load a diagram using the loadsoap diagram method and then add a handler to handle the ToolDeactivate event my event handler is not being called. Other registered events are getting fired. A sample of this is attached. Any help would be appreciated. Thanks Truman WindowsApplication4_3089.zip

2 Replies

AD Administrator Syncfusion Team December 2, 2004 07:43 PM UTC

Hi Truman The Diagram internally calls MVCDispose() which destroys the model, view, and controller and ensures that they are completely disconnected from the diagram control, when you load a serialized Diagram. This seems to be a bug and I have brought it to the attention of the Diagram team. This behaviour is also exhibited in the Serialization sample that ships with Essential Diagram. Here is some code that can be added to the OpenFile()routine to wire the eventhandler to the new Controller to work around this issue for now: this.diagram1.Refresh(); //Wire the Controller Events this.diagram1.Controller.EventsEnabled = true; this.diagram1.Controller.ToolActivate+=new Syncfusion.Windows.Forms.Diagram.Controller.ToolEventHandler(diagram1_Controller_ToolActivate); Regards Arun


AD Administrator Syncfusion Team December 2, 2004 08:24 PM UTC

I found that I had to actually call CreateController() on the diagram. When the event handler was called after I had set EventsEnabled to true the Controller was nothing and the event threw and exception. Truman

Loader.
Live Chat Icon For mobile
Up arrow icon