This topic has not yet been rated - Rate this topic

DeviceExtendedProperties.TryGetValue Method

Windows Phone

March 22, 2012

Retrieves an object representing the specified device property.

Namespace:  Microsoft.Phone.Info
Assembly:  Microsoft.Phone (in Microsoft.Phone.dll)
public static bool TryGetValue(
	string propertyName,
	out Object propertyValue
)

Parameters

propertyName
Type: System.String
The name of the device property to be retrieved. Property names are case-sensitive.
propertyValue
Type: System.Object %
The output parameter object in which the value of the device property is stored.

Return Value

Type: System.Boolean
Returns Boolean.
Caution note Caution:

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.

TryGetValue(String, Object) returns true if the specified property was successfully retrieved. For a complete list of supported device extended properties, see Device Status for Windows Phone. GetValue(String) provides the same functionality as TryGetValue(String, Object), but uses a different syntax that you may prefer.

Important note Important 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 Windows Phone Marketplace. However, if you use the GetValue method to get the ApplicationWorkingSetLimit, you can opt out of the device identity capability by removing it from the application manifest prior to application ingestion and it will not be added back in during the ingestion process.

This method may throw one of the following exceptions.

ArgumentNullException

The specified property name is null.

Windows Phone OS

Supported in: 7.1, 7.0

Windows Phone

Did you find this helpful?
(1500 characters remaining)