setXamlEventMethod

setXamlEventMethod(control:    String;
                   xamlEvent:  String;
                   jadeMethod: Method);

The setXamlEventMethod method of the JadeXamlControl class registers the control for other Window Presentation Foundation (WPF) control events apart from the standard JADE events.

The parameters of the setXamlEventMethod are described in the following table.

Parameter Name of the …
control WPF FrameworkElement. If the name is null or the same as the name of the control, the event is for the parent XAML element; otherwise the event is for the child element with the supplied name.
xamlEvent WPF event to be registered.
jadeMethod JADE method on the form that is to be called when the event occurs. The method must have the method-name(xamlControl: JadeXamlControl, itemName: String); signature, where the xamlControl value is the control receiving the event and the itemName value is the WPF element invoking the event. If this parameter is null, an existing event registered for the controlName, xamlEvent combination is removed.

An exception is raised if is the xamlEvent parameter is not a defined WPF event for the control, or if the jadeMethod parameter is not a defined method on the form or a superclass.

If the control is a subclass of JadeXamlControl and has a method with the same name as the jadeMethod parameter, the event calls the subclass method rather than the form method.

The following code fragment shows the use of the setXamlEventMethod method to register the myTextChanged method to receive the TextChanged event.

jadeXamlCtl.setXamlEventMethod("text1","TextChanged",MyForm::myTextChanged);