PropertyValue PropertyValue PropertyValue PropertyValue Class

Definition

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

public : static class PropertyValue
static struct winrt::Windows::Foundation::PropertyValue
public static class PropertyValue
Public Static Class PropertyValue
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.FoundationContract (introduced v1)

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) CreateBoolean(Boolean) CreateBoolean(Boolean) CreateBoolean(Boolean)

Creates a property value from a Boolean value.

public : static Platform::Object CreateBoolean(bool value)
winrt::Windows::Foundation::IInspectable CreateBoolean(bool value) const;
public static object CreateBoolean(Boolean value)
Public Static Function CreateBoolean(value As Boolean) As object
Parameters
value
Boolean Boolean

The value to store in the property value.

Returns
object object

The property value.

CreateBooleanArray(Boolean[]) CreateBooleanArray(Boolean[]) CreateBooleanArray(Boolean[]) CreateBooleanArray(Boolean[])

Creates a property value from an array of Boolean values.

public : static Platform::Object CreateBooleanArray(bool[] value)
winrt::Windows::Foundation::IInspectable CreateBooleanArray(bool[] value) const;
public static object CreateBooleanArray(Boolean[] value)
Public Static Function CreateBooleanArray(value As Boolean[]) As object
Parameters
value
Boolean[] Boolean[]

The array to store in the property value.

Returns
object object

The property value.

CreateChar16(Char) CreateChar16(Char) CreateChar16(Char) CreateChar16(Char)

Creates a property value from a Unicode character.

public : static Platform::Object CreateChar16(Char value)
winrt::Windows::Foundation::IInspectable CreateChar16(char value) const;
public static object CreateChar16(Char value)
Public Static Function CreateChar16(value As Char) As object
Parameters
value
Char Char

The value to store in the property value.

Returns
object object

The property value.

CreateChar16Array(Char[]) CreateChar16Array(Char[]) CreateChar16Array(Char[]) CreateChar16Array(Char[])

Creates a property value from an array of Unicode characters.

public : static Platform::Object CreateChar16Array(Char[] value)
winrt::Windows::Foundation::IInspectable CreateChar16Array(char[] value) const;
public static object CreateChar16Array(Char[] value)
Public Static Function CreateChar16Array(value As Char[]) As object
Parameters
value
Char[] Char[]

The array to store in the property value.

Returns
object object

The property value.

CreateDateTime(DateTime) CreateDateTime(DateTime) CreateDateTime(DateTime) CreateDateTime(DateTime)

Creates a property value from a date and time value.

public : static Platform::Object CreateDateTime(DateTime value)
winrt::Windows::Foundation::IInspectable CreateDateTime(DateTime value) const;
public static object CreateDateTime(DateTimeOffset value)
Public Static Function CreateDateTime(value As DateTimeOffset) As object
Parameters
value
DateTimeOffset DateTimeOffset

The value to store in the property value.

Returns
object object

The property value.

CreateDateTimeArray(DateTime[]) CreateDateTimeArray(DateTime[]) CreateDateTimeArray(DateTime[]) CreateDateTimeArray(DateTime[])

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

public : static Platform::Object CreateDateTimeArray(DateTime[] value)
winrt::Windows::Foundation::IInspectable CreateDateTimeArray(DateTime[] value) const;
public static object CreateDateTimeArray(DateTime[] value)
Public Static Function CreateDateTimeArray(value As DateTime[]) As object
Parameters
value
DateTime[] DateTime[]

The array to store in the property value.

Returns
object object

The property value.

CreateDouble(Double) CreateDouble(Double) CreateDouble(Double) CreateDouble(Double)

Creates a property value from a floating-point value.

public : static Platform::Object CreateDouble(double value)
winrt::Windows::Foundation::IInspectable CreateDouble(double value) const;
public static object CreateDouble(Double value)
Public Static Function CreateDouble(value As Double) As object
Parameters
value
Double Double

The value to store in the property value.

Returns
object object

The property value.

CreateDoubleArray(Double[]) CreateDoubleArray(Double[]) CreateDoubleArray(Double[]) CreateDoubleArray(Double[])

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

public : static Platform::Object CreateDoubleArray(double[] value)
winrt::Windows::Foundation::IInspectable CreateDoubleArray(double[] value) const;
public static object CreateDoubleArray(Double[] value)
Public Static Function CreateDoubleArray(value As Double[]) As object
Parameters
value
Double[] Double[]

The array to store in the property value.

Returns
object object

The property value.

CreateEmpty() CreateEmpty() CreateEmpty() CreateEmpty()

Creates an empty property value.

public : static Platform::Object CreateEmpty()
winrt::Windows::Foundation::IInspectable CreateEmpty() const;
public static object CreateEmpty()
Public Static Function CreateEmpty() As object
Returns
object object

The property value.

CreateGuid(Guid) CreateGuid(Guid) CreateGuid(Guid) CreateGuid(Guid)

Creates a property value from a GUID.

public : static Platform::Object CreateGuid(Platform::Guid value)
winrt::Windows::Foundation::IInspectable CreateGuid(Guid value) const;
public static object CreateGuid(Guid value)
Public Static Function CreateGuid(value As Guid) As object
Parameters
value
Guid Guid

The value to store in the property value.

Returns
object object

The property value.

CreateGuidArray(Guid[]) CreateGuidArray(Guid[]) CreateGuidArray(Guid[]) CreateGuidArray(Guid[])

Creates a property value from an array of GUID.

public : static Platform::Object CreateGuidArray(Platform::Guid[] value)
winrt::Windows::Foundation::IInspectable CreateGuidArray(Guid[] value) const;
public static object CreateGuidArray(Guid[] value)
Public Static Function CreateGuidArray(value As Guid[]) As object
Parameters
value
Guid[] Guid[]

The array to store in the property value.

Returns
object object

The property value.

CreateInspectable(Object) CreateInspectable(Object) CreateInspectable(Object) CreateInspectable(Object)

Creates a property value from an inspectable object.

public : static Platform::Object CreateInspectable(Platform::Object value)
winrt::Windows::Foundation::IInspectable CreateInspectable(winrt::Windows::Foundation::IInspectable value) const;
public static object CreateInspectable(Object value)
Public Static Function CreateInspectable(value As Object) As object
Parameters
value
Object Object

The object to store in the property value.

Returns
object object

The property value.

CreateInspectableArray(Object[]) CreateInspectableArray(Object[]) CreateInspectableArray(Object[]) CreateInspectableArray(Object[])

Creates a property value from an array of inspectable objects.

public : static Platform::Object CreateInspectableArray(Platform::Object[] value)
winrt::Windows::Foundation::IInspectable CreateInspectableArray(winrt::Windows::Foundation::IInspectable[] value) const;
public static object CreateInspectableArray(Object[] value)
Public Static Function CreateInspectableArray(value As Object[]) As object
Parameters
value
Object[] Object[]

The array to store in the property value.

Returns
object object

The property value.

CreateInt16(Int16) CreateInt16(Int16) CreateInt16(Int16) CreateInt16(Int16)

Creates a property value from an integer.

public : static Platform::Object CreateInt16(short value)
winrt::Windows::Foundation::IInspectable CreateInt16(short value) const;
public static object CreateInt16(Int16 value)
Public Static Function CreateInt16(value As Int16) As object
Parameters
value
Int16 Int16

The value to store in the property value.

Returns
object object

The property value.

CreateInt16Array(Int16[]) CreateInt16Array(Int16[]) CreateInt16Array(Int16[]) CreateInt16Array(Int16[])

Creates a property value from an array of integers.

public : static Platform::Object CreateInt16Array(short[] value)
winrt::Windows::Foundation::IInspectable CreateInt16Array(short[] value) const;
public static object CreateInt16Array(Int16[] value)
Public Static Function CreateInt16Array(value As Int16[]) As object
Parameters
value
Int16[] Int16[]

The array to store in the property value.

Returns
object object

The property value.

CreateInt32(Int32) CreateInt32(Int32) CreateInt32(Int32) CreateInt32(Int32)

Creates a property value from an integer.

public : static Platform::Object CreateInt32(int value)
winrt::Windows::Foundation::IInspectable CreateInt32(int32_t value) const;
public static object CreateInt32(Int32 value)
Public Static Function CreateInt32(value As Int32) As object
Parameters
value
Int32 Int32

The value to store in the property value.

Returns
object object

The property value.

CreateInt32Array(Int32[]) CreateInt32Array(Int32[]) CreateInt32Array(Int32[]) CreateInt32Array(Int32[])

Creates a property value from an array of integers.

public : static Platform::Object CreateInt32Array(int[] value)
winrt::Windows::Foundation::IInspectable CreateInt32Array(int32_t[] value) const;
public static object CreateInt32Array(Int32[] value)
Public Static Function CreateInt32Array(value As Int32[]) As object
Parameters
value
Int32[] Int32[]

The array to store in the property value.

Returns
object object

The property value.

CreateInt64(Int64) CreateInt64(Int64) CreateInt64(Int64) CreateInt64(Int64)

Creates a property value from an integer.

public : static Platform::Object CreateInt64(long value)
winrt::Windows::Foundation::IInspectable CreateInt64(long value) const;
public static object CreateInt64(Int64 value)
Public Static Function CreateInt64(value As Int64) As object
Parameters
value
Int64 Int64

The value to store in the property value.

Returns
object object

The property value.

CreateInt64Array(Int64[]) CreateInt64Array(Int64[]) CreateInt64Array(Int64[]) CreateInt64Array(Int64[])

Creates a property value from an array of integers.

public : static Platform::Object CreateInt64Array(long[] value)
winrt::Windows::Foundation::IInspectable CreateInt64Array(long[] value) const;
public static object CreateInt64Array(Int64[] value)
Public Static Function CreateInt64Array(value As Int64[]) As object
Parameters
value
Int64[] Int64[]

The array to store in the property value.

Returns
object object

The property value.

CreatePoint(Point) CreatePoint(Point) CreatePoint(Point) CreatePoint(Point)

Creates a property value from a point structure.

public : static Platform::Object CreatePoint(Point value)
winrt::Windows::Foundation::IInspectable CreatePoint(Point value) const;
public static object CreatePoint(Point value)
Public Static Function CreatePoint(value As Point) As object
Parameters
value
Point Point

The structure to store in the property value.

Returns
object object

The property value.

CreatePointArray(Point[]) CreatePointArray(Point[]) CreatePointArray(Point[]) CreatePointArray(Point[])

Creates a property value from an array of point structures.

public : static Platform::Object CreatePointArray(Point[] value)
winrt::Windows::Foundation::IInspectable CreatePointArray(Point[] value) const;
public static object CreatePointArray(Point[] value)
Public Static Function CreatePointArray(value As Point[]) As object
Parameters
value
Point[] Point[]

The array to store in the property value.

Returns
object object

The property value.

CreateRect(Rect) CreateRect(Rect) CreateRect(Rect) CreateRect(Rect)

Creates a property value from a rectangle structure.

public : static Platform::Object CreateRect(Rect value)
winrt::Windows::Foundation::IInspectable CreateRect(Rect value) const;
public static object CreateRect(Rect value)
Public Static Function CreateRect(value As Rect) As object
Parameters
value
Rect Rect

The structure to store in the property value.

Returns
object object

The property value.

CreateRectArray(Rect[]) CreateRectArray(Rect[]) CreateRectArray(Rect[]) CreateRectArray(Rect[])

Creates a property value from an array of rectangle structures.

public : static Platform::Object CreateRectArray(Rect[] value)
winrt::Windows::Foundation::IInspectable CreateRectArray(Rect[] value) const;
public static object CreateRectArray(Rect[] value)
Public Static Function CreateRectArray(value As Rect[]) As object
Parameters
value
Rect[] Rect[]

The array to store in the property value.

Returns
object object

The property value.

CreateSingle(Single) CreateSingle(Single) CreateSingle(Single) CreateSingle(Single)

Creates a property value from a floating-point value.

public : static Platform::Object CreateSingle(float value)
winrt::Windows::Foundation::IInspectable CreateSingle(Single value) const;
public static object CreateSingle(Single value)
Public Static Function CreateSingle(value As Single) As object
Parameters
value
Single Single

The value to store in the property value.

Returns
object object

The property value.

CreateSingleArray(Single[]) CreateSingleArray(Single[]) CreateSingleArray(Single[]) CreateSingleArray(Single[])

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

public : static Platform::Object CreateSingleArray(float[] value)
winrt::Windows::Foundation::IInspectable CreateSingleArray(Single[] value) const;
public static object CreateSingleArray(Single[] value)
Public Static Function CreateSingleArray(value As Single[]) As object
Parameters
value
Single[] Single[]

The array to store in the property value.

Returns
object object

The property value.

CreateSize(Size) CreateSize(Size) CreateSize(Size) CreateSize(Size)

Creates a property value from a size structure.

public : static Platform::Object CreateSize(Size value)
winrt::Windows::Foundation::IInspectable CreateSize(Size value) const;
public static object CreateSize(Size value)
Public Static Function CreateSize(value As Size) As object
Parameters
value
Size Size

The structure to store in the property value.

Returns
object object

The property value.

CreateSizeArray(Size[]) CreateSizeArray(Size[]) CreateSizeArray(Size[]) CreateSizeArray(Size[])

Creates a property value from an array of size structures.

public : static Platform::Object CreateSizeArray(Size[] value)
winrt::Windows::Foundation::IInspectable CreateSizeArray(Size[] value) const;
public static object CreateSizeArray(Size[] value)
Public Static Function CreateSizeArray(value As Size[]) As object
Parameters
value
Size[] Size[]

The array to store in the property value.

Returns
object object

The property value.

CreateString(String) CreateString(String) CreateString(String) CreateString(String)

Creates a property value from a string.

public : static Platform::Object CreateString(Platform::String value)
winrt::Windows::Foundation::IInspectable CreateString(winrt::hstring value) const;
public static object CreateString(String value)
Public Static Function CreateString(value As String) As object
Parameters
value
String String

The string to store in the property value.

Returns
object object

The property value.

CreateStringArray(String[]) CreateStringArray(String[]) CreateStringArray(String[]) CreateStringArray(String[])

Creates a property value from an array of strings.

public : static Platform::Object CreateStringArray(Platform::String[] value)
winrt::Windows::Foundation::IInspectable CreateStringArray(winrt::hstring[] value) const;
public static object CreateStringArray(String[] value)
Public Static Function CreateStringArray(value As String[]) As object
Parameters
value
String[] String[]

The array to store in the property value.

Returns
object object

The property value.

CreateTimeSpan(TimeSpan) CreateTimeSpan(TimeSpan) CreateTimeSpan(TimeSpan) CreateTimeSpan(TimeSpan)

Creates a property value from a time interval.

public : static Platform::Object CreateTimeSpan(TimeSpan value)
winrt::Windows::Foundation::IInspectable CreateTimeSpan(TimeSpan value) const;
public static object CreateTimeSpan(TimeSpan value)
Public Static Function CreateTimeSpan(value As TimeSpan) As object
Parameters
value
TimeSpan TimeSpan

The time interval to store in the property value.

Returns
object object

The property value.

CreateTimeSpanArray(TimeSpan[]) CreateTimeSpanArray(TimeSpan[]) CreateTimeSpanArray(TimeSpan[]) CreateTimeSpanArray(TimeSpan[])

Creates a property value from an array of time intervals.

public : static Platform::Object CreateTimeSpanArray(TimeSpan[] value)
winrt::Windows::Foundation::IInspectable CreateTimeSpanArray(TimeSpan[] value) const;
public static object CreateTimeSpanArray(TimeSpan[] value)
Public Static Function CreateTimeSpanArray(value As TimeSpan[]) As object
Parameters
value
TimeSpan[] TimeSpan[]

The array to store in the property value.

Returns
object object

The property value.

CreateUInt16(UInt16) CreateUInt16(UInt16) CreateUInt16(UInt16) CreateUInt16(UInt16)

Creates a property value from an unsigned integer.

public : static Platform::Object CreateUInt16(unsigned short value)
winrt::Windows::Foundation::IInspectable CreateUInt16(UInt16 value) const;
public static object CreateUInt16(UInt16 value)
Public Static Function CreateUInt16(value As UInt16) As object
Parameters
value
UInt16 UInt16

The value to store in the property value.

Returns
object object

The property value.

CreateUInt16Array(UInt16[]) CreateUInt16Array(UInt16[]) CreateUInt16Array(UInt16[]) CreateUInt16Array(UInt16[])

Creates a property value from an array of unsigned integers.

public : static Platform::Object CreateUInt16Array(unsigned short[] value)
winrt::Windows::Foundation::IInspectable CreateUInt16Array(UInt16[] value) const;
public static object CreateUInt16Array(UInt16[] value)
Public Static Function CreateUInt16Array(value As UInt16[]) As object
Parameters
value
UInt16[] UInt16[]

The array to store in the property value.

Returns
object object

The property value.

CreateUInt32(UInt32) CreateUInt32(UInt32) CreateUInt32(UInt32) CreateUInt32(UInt32)

Creates a property value from an unsigned integer.

public : static Platform::Object CreateUInt32(unsigned int value)
winrt::Windows::Foundation::IInspectable CreateUInt32(uint32_t value) const;
public static object CreateUInt32(UInt32 value)
Public Static Function CreateUInt32(value As UInt32) As object
Parameters
value
UInt32 UInt32

The value to store in the property value.

Returns
object object

The property value.

CreateUInt32Array(UInt32[]) CreateUInt32Array(UInt32[]) CreateUInt32Array(UInt32[]) CreateUInt32Array(UInt32[])

Creates a property value from an array of unsigned integers.

public : static Platform::Object CreateUInt32Array(unsigned int[] value)
winrt::Windows::Foundation::IInspectable CreateUInt32Array(uint32_t[] value) const;
public static object CreateUInt32Array(UInt32[] value)
Public Static Function CreateUInt32Array(value As UInt32[]) As object
Parameters
value
UInt32[] UInt32[]

The array to store in the property value.

Returns
object object

The property value.

CreateUInt64(UInt64) CreateUInt64(UInt64) CreateUInt64(UInt64) CreateUInt64(UInt64)

Creates a property value from an unsigned integer.

public : static Platform::Object CreateUInt64(unsigned __int64 value)
winrt::Windows::Foundation::IInspectable CreateUInt64(UInt64 value) const;
public static object CreateUInt64(UInt64 value)
Public Static Function CreateUInt64(value As UInt64) As object
Parameters
value
UInt64 UInt64

The value to store in the property value.

Returns
object object

The property value.

CreateUInt64Array(UInt64[]) CreateUInt64Array(UInt64[]) CreateUInt64Array(UInt64[]) CreateUInt64Array(UInt64[])

Creates a property value from an array of unsigned integers.

public : static Platform::Object CreateUInt64Array(unsigned __int64 value)
winrt::Windows::Foundation::IInspectable CreateUInt64Array(UInt64[] value) const;
public static object CreateUInt64Array(UInt64[] value)
Public Static Function CreateUInt64Array(value As UInt64[]) As object
Parameters
value
UInt64[] UInt64[]

The array to store in the property value.

Returns
object object

The property value.

CreateUInt8(Byte) CreateUInt8(Byte) CreateUInt8(Byte) CreateUInt8(Byte)

Creates a property value from a byte.

public : static Platform::Object CreateUInt8(Byte value)
winrt::Windows::Foundation::IInspectable CreateUInt8(Byte value) const;
public static object CreateUInt8(Byte value)
Public Static Function CreateUInt8(value As Byte) As object
Parameters
value
Byte Byte

The value to store in the property value.

Returns
object object

The property value.

CreateUInt8Array(Byte[]) CreateUInt8Array(Byte[]) CreateUInt8Array(Byte[]) CreateUInt8Array(Byte[])

Creates a property value from an array of bytes.

public : static Platform::Object CreateUInt8Array(Byte[] value)
winrt::Windows::Foundation::IInspectable CreateUInt8Array(Byte[] value) const;
public static object CreateUInt8Array(Byte[] value)
Public Static Function CreateUInt8Array(value As Byte[]) As object
Parameters
value
Byte[] Byte[]

The array to store in the property value.

Returns
object object

The property value.