How Do I Handle .NET Object Events? (Magic xpa 3.x)
When you are working with a .NET object, you will often want to execute some code based on an event raised by the object. This is done using a Magic xpa event handler. Handling .NET events is very similar to handling the other types of events in Magic xpa.
-
In the Logic tab, press Ctrl+H to create a new handler.
-
Type E to select Event. The Event window will appear.
-
Set the Event type to .NET.
-
Tab to the Event field and zoom. The .Net Event window will appear.
-
In the Variable field, zoom to select the .NET variable.
-
From the Event field, zoom to select the .NET event from the list.
-
Press Escape until you are back at the Event handler.
Hint: If you know the name of the object, you can just type it in rather than selecting it.
This event will now be handled by the event handler, for all .NET objects of the same type.
Note: When using .NET events, the issue of propagation is more complex than Magic xpa events. Refer to the Magic xpa Help for additional information.
The Online and Rich Client Samples projects (program NE01 and RNE01)