Figure 3. Delegate Event Handling in XAML Files.
This simple Avalon window includes a DockPanel with SimpleText, ComboBox, and Button controls. The ComboBox and Button elements have attribute/value pairs that delegate event handling to procedural code. The attribute name specifies the Avalon event name, and the value designates the name of the event handler (see Listing 1). An alternative approach is to include the event-handling code in the XAML file's CDATA element.