Described is a system and method for creating a runtime connection
interface for attributes and element tags defined declaratively in a
subclass within a markup document. These subclass attributes may define
an event, and the element tags scoped inside a subclass may define a
resource, and the like, associated with the subclass being defined within
the markup document. During runtime, the runtime connection interface
allows a parser to make direct calls to connect the subclass attribute
with an associated instance of the subclass. The system and method
include identifying an attribute or element tag defined within a markup
document. The attribute or element tag is associated with a target
element being declaratively defined within the markup document. The
attribute may define an event, and an element tag resource, and the like,
associated with a target element that is also declared within the
subclass in the markup. An identifier for the target element is
determined. An executable assembly is generated that provides a runtime
connection mechanism that is configured to attach an item associated with
the attribute or element tag to an instance of the target element during
runtime. Thus, in accordance with the present invention, an event handler
that is declaratively defined within markup is compiled in a manner such
that during runtime a direct call hooks up the event handler with the
instance of the target element.