I​Xaml​Type I​Xaml​Type I​Xaml​Type Interface

Definition

Provides the means to report XAML-type system specifics about XAML types. Using this interface contract, XAML parsers can load any custom types and members thereof that are defined in your app and are referenced in XAML files.

public interface IXamlTypepublic interface IXamlTypePublic Interface IXamlType
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Remarks

The Windows Runtime is a native Component Object Model (COM) based API. You can use several languages to write the app code, including Microsoft .NET languages and native C++. The Windows Runtime does not include reflection or a CLR-style type system. In absence of such a type system, the XAML framework for the Windows Runtime needs infrastructure and contracts to recognize and load any custom types that are defined in your app and are referenced in XAML files. The IXamlMember and IXamlType interfaces are the contract. The infrastructure is partially visible as a generated code file XamlTypeInfo.* (remainder of file name varying depending on which language you use). This file contains a partial class that extends the Application class and implements the IXamlMetadataProvider interface. The Windows Runtime XAML framework uses this interface to query for the details of types referenced in XAML files. Other generated files also use IXamlMetadataProvider for discovery.

Note

XamlTypeInfo.* can be found in the obj folder along with other generated files . You may need to enable Show all files to see it. Also, if you want to step into the type definition code, disable the Just my code feature in the debugger options.

Properties

BaseType BaseType BaseType

Gets the IXamlType for the immediate base type of the XAML type. Determination of this value is based on the underlying type for core types.

public IXamlType BaseType { get; }public IXamlType BaseType { get; }Public ReadOnly Property BaseType As IXamlType
Value
IXamlType IXamlType IXamlType

The IXamlType for the immediate base type of the XAML type.

Attributes

ContentProperty ContentProperty ContentProperty

Gets the IXamlMember information for the XAML content property of this IXamlType.

public IXamlMember ContentProperty { get; }public IXamlMember ContentProperty { get; }Public ReadOnly Property ContentProperty As IXamlMember
Value
IXamlMember IXamlMember IXamlMember

IXamlMember information for the XAML content property of the IXamlType. May be null if no XAML content property exists.

Attributes

FullName FullName FullName

Gets the full class name of the underlying type.

public PlatForm::String FullName { get; }public string FullName { get; }Public ReadOnly Property FullName As string
Value
string string string

The full class name of the underlying type.

Attributes

IsArray IsArray IsArray

Gets a value that indicates whether the IXamlType represents an array.

public PlatForm::Boolean IsArray { get; }public bool IsArray { get; }Public ReadOnly Property IsArray As bool
Value
bool bool bool

true if the IXamlType represents an array; otherwise, false.

Attributes
See Also

IsBindable IsBindable IsBindable

Gets a value that declares whether the type is bindable.

public PlatForm::Boolean IsBindable { get; }public bool IsBindable { get; }Public ReadOnly Property IsBindable As bool
Value
bool bool bool

true if the type is bindable, false if the type is not bindable.

Attributes

Remarks

The value of this property corresponds to application of the BindableAttribute to the underlying class for native C++ classes. The value is always true for all common language runtime (CLR) classes.

See Also

IsCollection IsCollection IsCollection

Gets a value that indicates whether this IXamlType represents a collection.

public PlatForm::Boolean IsCollection { get; }public bool IsCollection { get; }Public ReadOnly Property IsCollection As bool
Value
bool bool bool

true if this IXamlType represents a collection; otherwise, false.

Attributes
See Also

IsConstructible IsConstructible IsConstructible

Gets a value that indicates whether this IXamlType represents a constructible type, as per the XAML definition.

public PlatForm::Boolean IsConstructible { get; }public bool IsConstructible { get; }Public ReadOnly Property IsConstructible As bool
Value
bool bool bool

true if this IXamlType represents a constructible type; otherwise, false.

Attributes
See Also

IsDictionary IsDictionary IsDictionary

Gets a value that indicates whether this IXamlType represents a dictionary/map.

public PlatForm::Boolean IsDictionary { get; }public bool IsDictionary { get; }Public ReadOnly Property IsDictionary As bool
Value
bool bool bool

true if this IXamlType represents a dictionary/map; otherwise, false.

Attributes
See Also

IsMarkupExtension IsMarkupExtension IsMarkupExtension

Gets a value that indicates whether the IXamlType represents a markup extension.

public PlatForm::Boolean IsMarkupExtension { get; }public bool IsMarkupExtension { get; }Public ReadOnly Property IsMarkupExtension As bool
Value
bool bool bool

true if the IXamlType represents a markup extension; otherwise, false.

Attributes
See Also

ItemType ItemType ItemType

Gets a value that provides the type information for the Items property of this IXamlType.

public IXamlType ItemType { get; }public IXamlType ItemType { get; }Public ReadOnly Property ItemType As IXamlType
Value
IXamlType IXamlType IXamlType

The IXamlType information for the type of the items in the collection; otherwise, null if this IXamlType does not represent a collection.

Attributes

KeyType KeyType KeyType

Gets a value that provides the type information for the Key property of this IXamlType, if this IXamlType represents a dictionary/map.

public IXamlType KeyType { get; }public IXamlType KeyType { get; }Public ReadOnly Property KeyType As IXamlType
Value
IXamlType IXamlType IXamlType

The IXamlType information for the type of the key for dictionary usage; otherwise, null if this IXamlType does not represent a dictionary/map.

Attributes

UnderlyingType UnderlyingType UnderlyingType

Gets information for the backing type.

public TypeName UnderlyingType { get; }public Type UnderlyingType { get; }Public ReadOnly Property UnderlyingType As Type
Value
TypeName TypeName TypeName

The backing type as represented by the relevant type system or interop support type. This is a type reference (System.Type for Microsoft .NET, a TypeName helper struct for Visual C++ component extensions (C++/CX)).

Attributes

Remarks

Note

If you are programming using a Microsoft .NET language (C# or Microsoft Visual Basic), the TypeName type projects as System.Type. If you're using Visual C++ component extensions (C++/CX)), this is a TypeName helper struct.

Methods

ActivateInstance() ActivateInstance() ActivateInstance()

Given a XAML type, sets its values for initialization and returns a usable instance.

public PlatForm::Object ActivateInstance()public object ActivateInstance()Public Function ActivateInstance() As object
Returns
object object object

The usable instance.

Attributes

Remarks

This is an infrastructure API that replicates ActivateInstance for XAML activation.

AddToMap(Object, Object, Object) AddToMap(Object, Object, Object) AddToMap(Object, Object, Object)

Adds an item to a custom map type.

public void AddToMap(Object instance, Object key, Object value)public void AddToMap(Object instance, Object key, Object value)Public Function AddToMap(instance As Object, key As Object, value As Object) As void
Parameters
instance
System.Object System.Object System.Object

The type instance to set the map item to.

key
System.Object System.Object System.Object

The key of the map item to add.

value
System.Object System.Object System.Object

The value of the map item to add.

Attributes

AddToVector(Object, Object) AddToVector(Object, Object) AddToVector(Object, Object)

Adds an item to a custom vector type.

public void AddToVector(Object instance, Object value)public void AddToVector(Object instance, Object value)Public Function AddToVector(instance As Object, value As Object) As void
Parameters
instance
System.Object System.Object System.Object

The type instance to set the item to.

value
System.Object System.Object System.Object

The value of the item to add.

Attributes

CreateFromString(String) CreateFromString(String) CreateFromString(String)

Creates a type system representation based on a string. The main scenario for this usage is creating an enumeration value and mapping the appropriate enumeration.

public PlatForm::Object CreateFromString(String value)public object CreateFromString(String value)Public Function CreateFromString(value As String) As object
Parameters
value
System.String System.String System.String

The string to create from.

Returns
object object object

The resulting type system representation.

Attributes

GetMember(String) GetMember(String) GetMember(String)

Returns the IXamlMember information for a specific named member from this IXamlType.

public IXamlMember GetMember(String name)public IXamlMember GetMember(String name)Public Function GetMember(name As String) As IXamlMember
Parameters
name
System.String System.String System.String

The name of the member to get (as a string).

Returns

The IXamlMember information for the member, if a member as specified by name was found; otherwise, null.

Attributes

RunInitializer() RunInitializer() RunInitializer()

Invokes any necessary pre-activation logic as required by the XAML schema context and its platform dependencies.

public void RunInitializer()public void RunInitializer()Public Function RunInitializer() As void
Attributes

See Also