5.2 XamlType Information Item
A XamlType Information Item defines a data type. For example, an Object Node Information Item (section 6.2) has a [type] property that refers to a XamlType Information Item.
Table 4: XamlType Information Item Properties
Name |
Type |
Purpose (non-normative) |
[name] |
The name that represents this type. Case is significant. |
|
[types assignable to] |
Set of XamlType Information Items |
The types to which instances of this type are considered assignable. |
[is default constructible] |
When True, this type may always be used as the type for an object node. When False, constraints apply, which are described later in this specification. |
|
[is nullable] |
True if members of this type may have a Null value. |
|
[text syntax] |
Null, or Text Syntax Information Item |
The text syntax that defines how instances of this type can be represented as text. |
[members] |
Set of XamlMember Information Items |
The members available on this type. |
[content property] |
Null, or a XamlMember Information Item |
The member to which content of an element of this type can be assigned. (Allows XML representations to omit the member element.) |
[dictionary key property] |
Null, or a XamlMember Information Item |
The member that acts as the key if an element of this type is added to a dictionary without a key being specified explicitly. The designated member is effectively an alias for the x:Key Directive (section 7.3.5). |
[name property] |
Null, or a XamlMember Information Item |
The member that, if set, holds the name of an element of this type. The designated member is effectively an alias for the x:Name Directive (section 7.3.4). |
[xml lang property] |
Null, or a XamlMember Information Item |
The member that holds the value of the xml:lang attribute (when present); the designated member is effectively an alias for the xml:lang Directive (section 7.3.13). |
[trim surrounding whitespace] |
True if whitespace immediately before and after elements of this type in an XML representation should be removed. |
|
[is whitespace significant collection] |
True if, when a Xaml processor reads an XML representation of an element of this type, whitespace content should not be collapsed. |
|
[is list] |
True if elements of this type contain an ordered sequence of items. |
|
[is dictionary] |
True if elements of this type contain a set of items, each identified by a key. |
|
[allowed types] |
Set of XamlType Information Items |
The types that can be added as items inside a list or dictionary. (Only used if [is list] or [is dictionary] is True.) |
[allowed key types] |
Set of XamlType Information Items |
The types that can be used as keys. (Only used if [is dictionary] is True.) |
[is xdata] |
True if elements of this type contain literal XML data. |
|
[is name scope] |
Used to determine the scope in which values of the x:Name Directive (section 7.3.4) must be unique. |
|
[constructors] |
The constructors that can be used to create instances of this type. |
|
[return value type] |
Null, or a XamlType Information Item |
The type of value provided by this type. (Only used for markup extensions; see the x:MarkupExtension (section 7.2.22) type.) |
[is generic] |
True if elements of this type can accept x:TypeArguments Directive (section 7.3.11). |
The [types assignable to] property contains the complete set of types from this schema to which instances of this type are assignable. If a vocabulary wishes to provide common object-oriented semantics, such as having a type be assignable to all the types to which its base class is assignable, it must make that explicit. However, there is an additional complexity regarding schemas that list other schemas in their [compatible with schemas]. Types do not include types from the schemas with which they are compatible with their [types assignable to]. Instead, this specification presumes that equivalently named types in compatible schemas are compatible. To simplify the validity checks that presume this, the following functions are defined:
Informally, a type tFrom is assignable to a type tTo if either tFrom and tTo are compatible, or if tFrom [types assignable to] contains a type which is compatible with tTo; types are compatible with types that have the same name and compatible schemas.