Windows.Foundation.Metadata Namespace

Provides fundamental metadata types used throughout the Windows Runtime API. This namespace contains attributes and types that are essential for describing and interacting with Windows Runtime components.

Namespace Details

The Windows.Foundation.Metadata namespace is crucial for understanding how Windows Runtime types are defined, versioned, and exposed. It includes attributes that developers can use to decorate their own Windows Runtime components, ensuring compatibility and enabling rich metadata for tools and the system itself.

Key uses include:

  • Specifying the platform version for a type or member.
  • Indicating that a type is an interface, class, struct, or enum.
  • Providing information about the origin and deprecation status of Windows Runtime elements.

Classes

No public classes are directly exposed in this namespace that are typically instantiated by application developers. The primary components are attributes used for metadata.

Interfaces

No public interfaces are directly exposed in this namespace for general application use.

Structs

No public structs are directly exposed in this namespace for general application use.

Enums

No public enums are directly exposed in this namespace for general application use.

Attributes

The following attributes are key members of the Windows.Foundation.Metadata namespace, used to define and describe Windows Runtime APIs.

  • 🌟
    [AllowMultiple] Attribute

    Indicates that an attribute can be applied more than once to the same target.

  • 📅
    [ApiInformationKind] Attribute

    Defines the kind of API information being provided. Used with ApiInformation.

  • 🚀
    [AttributeUsage] Attribute

    Specifies the valid locations for custom attributes in your code.

  • 💡
    [ContractVersion] Attribute

    Specifies the version of a Windows Runtime contract.

  • 🚫
    [Deprecated] Attribute

    Marks a type or member as deprecated, indicating it should no longer be used.

  • 🏛️
    [Deprecated] Attribute(String message, Platform platform)`

    Marks a type or member as deprecated with a specific message and platform information.

  • [Deprecated] Attribute(String message, Int32 majorVersion, Int32 minorVersion)`

    Marks a type or member as deprecated, specifying the version at which it was deprecated.

  • 📦
    [Guid] Attribute

    Associates a GUID with a Windows Runtime type.

  • 🔗
    [InterfaceType] Attribute

    Specifies the COM interface type (e.g., IInspectable, ComInterface).

  • 📈
    [Range] Attribute

    Specifies the minimum and maximum values for an enumeration or integer type.

  • [Range] Attribute(Int32 minValue, Int32 maxValue)`

    Specifies the minimum and maximum values for an enumeration or integer type with explicit bounds.

  • [WebHostHidden] Attribute

    Indicates that a type or member should be hidden from web hosts.

  • See Also