Object::GetType Method

Returns a Platform::Type object that describes the runtime type of an object.

A Platform::Type object that describes the runtime type of the object.

The static Type::GetTypeCode Method can be used to get a Platform::TypeCode Enumeration value that represents the current type. This is mostly useful for built-in types. The type code for any ref class besides Platform::String is Object (1).

The Windows::UI::Xaml::Interop::TypeName class is used in the Windows APIs as a language-independent way of passing type information between Windows components and apps. The TPlatform::Type Class has operators for converting between Type and TypeName.

Use the typeid operator to return a Platform::Type object for a class name, for example when navigating between XAML pages:

rootFrame->Navigate(TypeName(MainPage::typeid), e->Arguments);
Show:
© 2014 Microsoft