Enables a value type such as Windows::Foundation::DateTime or a scalar type such as int to be stored in a Platform::Object type. It is usually not necessary to use Box explicitly because boxing happens implicitly when you cast a value type to Object^.
ref class Box abstract;Header: vccorlib.h
Namespace: Platform
Creates a Box that can encapsulate a value of the specified type.|
|Value property|Returns the value that is encapsulated in the Box object.|
Box(T valueArg);valueArg
The type of value to be boxed—for example, int, bool, float64, DateTime.
Enables boxing conversions from a const value class T or enum class T to Box<T>.
operator Box<const T>^(const T valueType);T
Any value class, value struct, or enum type. Includes the built-in types in the default namespace.
A Platform::Box<T>^ instance that represents the original value boxed in a ref class.
Enables boxing conversions from a const volatile value class T or enum type T to Box<T>.
operator Box<const volatile T>^(const volatile T valueType);T
Any enum type, value class, or value struct. Includes the built-in types in the default namespace.
A Platform::Box<T>^ instance that represents the original value boxed in a ref class.
Enables boxing conversions from a value class T to Box<T>.
operator Box<const T>^(const T valueType);T
Any enum type, value class, or value struct. Includes the built-in types in the default namespace.
A Platform::Box<T>^ instance that represents the original value boxed in a ref class.
Enables boxing conversions from a volatile value class T or enum type T to Box<T>.
operator Box<volatile T>^(volatile T valueType);T
Any enum type, value class, or value struct. Includes the built-in types in the default namespace.
A Platform::Box<T>^ instance that represents the original value boxed in a ref class.
Enables boxing conversions from a value class T or enum class T to Box<T>.
operator Box<T>^(T valueType);T
Any enum type, value class, or value struct. Includes the built-in types in the default namespace.
A Platform::Box<T>^ instance that represents the original value boxed in a ref class.
Returns the value that is encapsulated in the Box object.
virtual property T Value{
T get();
}Returns the boxed value with the same type as it originally had before it was boxed.
