DeviceExtendedProperties.GetValue Method

July 28, 2014

Retrieves an object representing the specified device property.

Namespace:  Microsoft.Phone.Info
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)

public static Object GetValue(
	string propertyName
)

Parameters

propertyName
Type: System.String
The name of the device property to be retrieved. Property names are case-sensitive.

Return Value

Type: System.Object
Returns Object.

ExceptionCondition
ArgumentNullException

The specified property name is null.

ArgumentOutOfRangeException

The specified property does not exist.

UnauthorizedAccessException

The capability to retrieve the property has not been granted.

NotSupportedException

The specified property cannot be retrieved.

Caution noteCaution:

In Windows Phone OS 7.0, the DeviceExtendedProperties class was used to query device-specific properties. In Windows Phone OS 7.1, most of the properties in DeviceExtendedProperties were deprecated, and the new DeviceStatus class should be used instead. However, where appropriate, you can still use the properties in DeviceExtendedProperties that are not deprecated.

For a full list of properties that can be queried by this method, see DeviceExtendedProperties.

GetValue(String) either will return a non-null object containing the requested value or will throw one of the exceptions listed in the following table. TryGetValue(String, Object) provides the same functionality as GetValue(String), but uses a different syntax that you may prefer.

Important noteImportant Note:

DeviceExtendedProperties requires the device identity capability. If your application uses this class, the user will be alerted that the application requires access to the device identity when viewing your application on Store. For this reason, we recommend that you use this class only if your application requires it.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2014 Microsoft