DeviceExtendedProperties.TryGetValue Method
[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]
Retrieves an object representing the specified device property.
Assembly: Microsoft.Phone (in Microsoft.Phone.dll)
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.
| Exception | Condition |
|---|---|
| ArgumentNullException | The specified property name is null. |
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 8. GetValue(String) provides the same functionality as TryGetValue(String, Object), but uses a different syntax that you may prefer.
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 Store. For this reason, we recommend that you use this class only if your application requires it. |
Caution: