Get's the value of a system property.
| C# | Visual Basic |
public static Object GetValue( SystemProperty property )
Public Shared Function GetValue ( _ property As SystemProperty _ ) As Object
- property (SystemProperty)
- System property to retrieve the value of.
either an int, string, or byte[] representing the value of the property.
You can use the 'is' operator to determine which type it is.
The following example shows how to query the battery strength of the device:
CopyC
CopyVB.NET
BatteryLevel batteryLevel = SystemState.PowerBatteryStrength;
Dim batteryLevel As BatteryLevel = SystemState.PowerBatteryStrength
The following example shows how to query a system state via a variable:
CopyC#
CopyVB.NET
SystemProperty property = SystemProperty.PowerBatteryStrength; BatteryLevel batteryLevel = (BatteryLevel)SystemState.GetValue(property);
Dim property As SystemProperty = SystemProperty.PowerBatteryStrength Dim batteryLevel As BatteryLevel = CType(SystemState.GetValue(property), BatteryLevel)