PropertyValue Class

Definition

Represents a value in a property store (such as a PropertySet instance).

public ref class PropertyValue abstract sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.FoundationContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
/// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
class PropertyValue final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.FoundationContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)]
public static class PropertyValue
Public Class PropertyValue
Inheritance
Object Platform::Object IInspectable PropertyValue
Attributes

Windows requirements

Device family
Windows 10 (introduced in 10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced in v1.0)

Remarks

PropertyValue represents the value portion of a property that typically has a string name, and some value. There are multiple properties in a property set, and each property potentially has a different value type, so from a collection standpoint the collection is mixed, not strongly typed. The PropertySet class and the IPropertySet interface are existing interfaces or implementations that use this model and use a PropertyValue as the value part of a key-value pair. IPropertySet is the type of various Windows Runtime properties where the goal is to provide your app with a property bag of properties that are conceptually related in their origin, but each property might (and often does) use a different value type.

When used by other Windows Runtime APIs and their signatures, values are often passed as the IPropertyValue interface rather than as the PropertyValue type.

In addition to representing the value itself, PropertyValue defines utility methods that populate a PropertyValue instance. Calling these utility methods from app code is uncommon. The methods create a boxed value, and in this aspect a PropertyValue instance functions similarly to the VARIANT concept from Component Object Model (COM). Each method has a matched method that creates an array of values as opposed to a single value.

Methods

CreateBoolean(Boolean)

Creates a property value from a Boolean value.

CreateBooleanArray(Boolean[])

Creates a property value from an array of Boolean values.

CreateChar16(Char)

Creates a property value from a Unicode character.

CreateChar16Array(Char[])

Creates a property value from an array of Unicode characters.

CreateDateTime(DateTime)

Creates a property value from a date and time value.

CreateDateTimeArray(DateTime[])

Creates a property value from an array of date and time values.

CreateDouble(Double)

Creates a property value from a floating-point value.

CreateDoubleArray(Double[])

Creates a property value from an array of floating-point values.

CreateEmpty()

Creates an empty property value.

CreateGuid(Guid)

Creates a property value from a GUID.

CreateGuidArray(Guid[])

Creates a property value from an array of GUIDs.

CreateInspectable(Object)

Supplies the property value representation of an inspectable object. Since an object is a reference type, it is also a valid property value and does not need to be boxed. Instead, this method returns the object provided without modification. An object can be set as a property value without first calling this method.

CreateInspectableArray(Object[])

Creates a property value from an array of inspectable objects.

CreateInt16(Int16)

Creates a property value from an integer.

CreateInt16Array(Int16[])

Creates a property value from an array of integers.

CreateInt32(Int32)

Creates a property value from an integer.

CreateInt32Array(Int32[])

Creates a property value from an array of integers.

CreateInt64(Int64)

Creates a property value from an integer.

CreateInt64Array(Int64[])

Creates a property value from an array of integers.

CreatePoint(Point)

Creates a property value from a point structure.

CreatePointArray(Point[])

Creates a property value from an array of point structures.

CreateRect(Rect)

Creates a property value from a rectangle structure.

CreateRectArray(Rect[])

Creates a property value from an array of rectangle structures.

CreateSingle(Single)

Creates a property value from a floating-point value.

CreateSingleArray(Single[])

Creates a property value from an array of floating-point values.

CreateSize(Size)

Creates a property value from a size structure.

CreateSizeArray(Size[])

Creates a property value from an array of size structures.

CreateString(String)

Creates a property value from a string.

CreateStringArray(String[])

Creates a property value from an array of strings.

CreateTimeSpan(TimeSpan)

Creates a property value from a time interval.

CreateTimeSpanArray(TimeSpan[])

Creates a property value from an array of time intervals.

CreateUInt16(UInt16)

Creates a property value from an unsigned integer.

CreateUInt16Array(UInt16[])

Creates a property value from an array of unsigned integers.

CreateUInt32(UInt32)

Creates a property value from an unsigned integer.

CreateUInt32Array(UInt32[])

Creates a property value from an array of unsigned integers.

CreateUInt64(UInt64)

Creates a property value from an unsigned integer.

CreateUInt64Array(UInt64[])

Creates a property value from an array of unsigned integers.

CreateUInt8(Byte)

Creates a property value from a byte.

CreateUInt8Array(Byte[])

Creates a property value from an array of bytes.

Applies to

See also