IXamlType IXamlType IXamlType IXamlType 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 IXamlType
struct winrt::Windows::UI::Xaml::Markup::IXamlType
public interface IXamlType
Public 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 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; }
IXamlType BaseType();
public IXamlType BaseType { get; }
Public ReadOnly Property BaseType As IXamlType
Value
IXamlType IXamlType IXamlType IXamlType

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

ContentProperty ContentProperty ContentProperty ContentProperty

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

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

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

FullName FullName FullName FullName

Gets the full class name of the underlying type.

public : Platform::String FullName { get; }
winrt::hstring FullName();
public string FullName { get; }
Public ReadOnly Property FullName As string
Value
string string

The full class name of the underlying type.

IsArray IsArray IsArray IsArray

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

public : Platform::Boolean IsArray { get; }
bool IsArray();
public bool IsArray { get; }
Public ReadOnly Property IsArray As bool
Value
bool bool

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

See Also

IsBindable IsBindable IsBindable IsBindable

Gets a value that declares whether the type is bindable.

public : Platform::Boolean IsBindable { get; }
bool IsBindable();
public bool IsBindable { get; }
Public ReadOnly Property IsBindable As bool
Value
bool bool

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

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 IsCollection

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

public : Platform::Boolean IsCollection { get; }
bool IsCollection();
public bool IsCollection { get; }
Public ReadOnly Property IsCollection As bool
Value
bool bool

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

See Also

IsConstructible 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; }
bool IsConstructible();
public bool IsConstructible { get; }
Public ReadOnly Property IsConstructible As bool
Value
bool bool

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

See Also

IsDictionary IsDictionary IsDictionary IsDictionary

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

public : Platform::Boolean IsDictionary { get; }
bool IsDictionary();
public bool IsDictionary { get; }
Public ReadOnly Property IsDictionary As bool
Value
bool bool

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

See Also

IsMarkupExtension IsMarkupExtension IsMarkupExtension IsMarkupExtension

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

public : Platform::Boolean IsMarkupExtension { get; }
bool IsMarkupExtension();
public bool IsMarkupExtension { get; }
Public ReadOnly Property IsMarkupExtension As bool
Value
bool bool

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

See Also

ItemType ItemType ItemType ItemType

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

public : IXamlType ItemType { get; }
IXamlType ItemType();
public IXamlType ItemType { get; }
Public ReadOnly Property ItemType As IXamlType
Value
IXamlType 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.

KeyType 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; }
IXamlType KeyType();
public IXamlType KeyType { get; }
Public ReadOnly Property KeyType As IXamlType
Value
IXamlType 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.

UnderlyingType UnderlyingType UnderlyingType UnderlyingType

Gets information for the backing type.

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

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)).

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.

See Also
TypeType

Methods

ActivateInstance() ActivateInstance() ActivateInstance() ActivateInstance()

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

public : Platform::Object ActivateInstance()
winrt::Windows::Foundation::IInspectable ActivateInstance() const;
public object ActivateInstance()
Public Function ActivateInstance() As object
Returns
object object

The usable instance.

Remarks

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

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

Adds an item to a custom map type.

public : void AddToMap(Platform::Object instance, Platform::Object key, Platform::Object value)
void AddToMap(winrt::Windows::Foundation::IInspectable instance, winrt::Windows::Foundation::IInspectable key, winrt::Windows::Foundation::IInspectable value) const;
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
Object Object

The type instance to set the map item to.

key
Object Object

The key of the map item to add.

value
Object Object

The value of the map item to add.

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

Adds an item to a custom vector type.

public : void AddToVector(Platform::Object instance, Platform::Object value)
void AddToVector(winrt::Windows::Foundation::IInspectable instance, winrt::Windows::Foundation::IInspectable value) const;
public void AddToVector(Object instance, Object value)
Public Function AddToVector(instance As Object, value As Object) As void
Parameters
instance
Object Object

The type instance to set the item to.

value
Object Object

The value of the item to add.

CreateFromString(String) 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(Platform::String value)
winrt::Windows::Foundation::IInspectable CreateFromString(winrt::hstring value) const;
public object CreateFromString(String value)
Public Function CreateFromString(value As String) As object
Parameters
value
String String

The string to create from.

Returns
object object

The resulting type system representation.

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

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

public : IXamlMember GetMember(Platform::String name)
IXamlMember GetMember(winrt::hstring name) const;
public IXamlMember GetMember(String name)
Public Function GetMember(name As String) As IXamlMember
Parameters
name
String 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.

RunInitializer() RunInitializer() RunInitializer() RunInitializer()

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

public : void RunInitializer()
void RunInitializer() const;
public void RunInitializer()
Public Function RunInitializer() As void

See Also