IXamlType IXamlType IXamlType Interface

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.

Syntax

Declaration

public interface IXamlTypepublic interface IXamlTypePublic Interface IXamlType

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 summary

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.

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

Gets the full class name of the underlying type.

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

Gets a value that declares whether the type is bindable.

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

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

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

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

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

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

Gets information for the backing type.

Methods summary

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

Adds an item to a custom map type.

Adds an item to a custom vector type.

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.

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

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

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; }public IXamlType BaseType { get; }Public ReadOnly Property BaseType As IXamlType

    Property Value

  • ContentProperty
    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

    Property Value

  • FullName
    FullName
    FullName
    FullName

    Gets the full class name of the underlying type.

    public string FullName { get; }public string FullName { get; }Public ReadOnly Property FullName As string

    Property Value

    • string
      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 bool IsArray { get; }public bool IsArray { get; }Public ReadOnly Property IsArray As bool

    Property Value

    • bool
      bool
      bool

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

  • IsBindable
    IsBindable
    IsBindable
    IsBindable

    Gets a value that declares whether the type is bindable.

    public bool IsBindable { get; }public bool IsBindable { get; }Public ReadOnly Property IsBindable As bool

    Property Value

    • bool
      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.

  • IsCollection
    IsCollection
    IsCollection
    IsCollection

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

    public bool IsCollection { get; }public bool IsCollection { get; }Public ReadOnly Property IsCollection As bool

    Property Value

    • bool
      bool
      bool

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

  • IsConstructible
    IsConstructible
    IsConstructible
    IsConstructible

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

    public bool IsConstructible { get; }public bool IsConstructible { get; }Public ReadOnly Property IsConstructible As bool

    Property Value

    • bool
      bool
      bool

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

  • IsDictionary
    IsDictionary
    IsDictionary
    IsDictionary

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

    public bool IsDictionary { get; }public bool IsDictionary { get; }Public ReadOnly Property IsDictionary As bool

    Property Value

    • bool
      bool
      bool

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

  • IsMarkupExtension
    IsMarkupExtension
    IsMarkupExtension
    IsMarkupExtension

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

    public bool IsMarkupExtension { get; }public bool IsMarkupExtension { get; }Public ReadOnly Property IsMarkupExtension As bool

    Property Value

    • bool
      bool
      bool

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

  • ItemType
    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

    Property Value

  • 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; }public IXamlType KeyType { get; }Public ReadOnly Property KeyType As IXamlType

    Property Value

  • UnderlyingType
    UnderlyingType
    UnderlyingType
    UnderlyingType

    Gets information for the backing type.

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

    Property Value

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

Methods

  • ActivateInstance()
    ActivateInstance()
    ActivateInstance()
    ActivateInstance()

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

    public object ActivateInstance()public object ActivateInstance()Public Function ActivateInstance() As object

    Returns

    • object
      object
      object

      The usable instance.

    Remarks

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

  • AddToMap(System.Object,System.Object,System.Object)
    AddToMap(System.Object,System.Object,System.Object)
    AddToMap(System.Object,System.Object,System.Object)
    AddToMap(System.Object,System.Object,System.Object)

    Adds an item to a custom map type.

    public void AddToMap(System.Object instance,System.Object key,System.Object value)public void AddToMap(System.Object instance,System.Object key,System.Object value)Public Function AddToMap(instance As System.Object,key As System.Object,value As System.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.

  • AddToVector(System.Object,System.Object)
    AddToVector(System.Object,System.Object)
    AddToVector(System.Object,System.Object)
    AddToVector(System.Object,System.Object)

    Adds an item to a custom vector type.

    public void AddToVector(System.Object instance,System.Object value)public void AddToVector(System.Object instance,System.Object value)Public Function AddToVector(instance As System.Object,value As System.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.

  • CreateFromString(System.String)
    CreateFromString(System.String)
    CreateFromString(System.String)
    CreateFromString(System.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 object CreateFromString(System.String value)public object CreateFromString(System.String value)Public Function CreateFromString(value As System.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.

  • GetMember(System.String)
    GetMember(System.String)
    GetMember(System.String)
    GetMember(System.String)

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

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

    Parameters

    • name
      System.String
      System.String
      System.String

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

    Returns

  • RunInitializer()
    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

Device family

Windows 10 (introduced v10.0.10240.0)

API contract

Windows.Foundation.UniversalApiContract (introduced v1)

Attributes

Windows.Foundation.Metadata.ContractVersionAttribute
Windows.Foundation.Metadata.WebHostHiddenAttribute
Windows.Foundation.Metadata.GuidAttribute

Details

Assembly

Windows.UI.Xaml.Markup.dll