Tags


Order of Property and Event Processing

At runtime, event handlers are always attached before any properties are set for any object declared in XAML (excluding the Name property. This enables appropriate events to be raised in response to properties being set without worrying about the order of attributes used in XAML.
The ordering of multiple property sets and multiple event handler attachments is usually performed in the relative order that property attributes and event attributes are specified on the object element. Fortunately, this ordering shouldn’t matter in practice because .NET design guidelines dictate that classes should allow properties to be set in any order, and the same holds true for attaching event handlers.

Advertisements