SimpleOrientationSensor.GetDefault | getDefault method
Gets the default simple orientation sensor.
Syntax
var simpleOrientationSensor = Windows.Devices.Sensors.SimpleOrientationSensor.getDefault();
Parameters
This method has no parameters.
Return value
Type: SimpleOrientationSensor
The default simple orientation sensor or null if no simple orientation sensors are found.
Remarks
This method only returns values for hardware that has been integrated into the computer by the manufacturer. (The simple orientation-sensor readings are derived from an accelerometer.) A null value will be returned if the specified sensor is not available in the system.
When a system is in Connected Standby, a call to the GetDefault method will return immediately with a null result.
The following example demonstrates how a Windows Store app built with XAML and C# used this method to establish a connection to the simple orientation sensor.
_sensor = SimpleOrientationSensor.GetDefault();
The following example demonstrates how a Windows Store app built for Windows using JavaScript used this method to establish a connection to the simple orientation sensor.
sensor = Windows.Devices.Sensors.SimpleOrientationSensor.getDefault();
Requirements
|
Minimum supported client | Windows 8 |
|---|---|
|
Minimum supported server | Windows Server 2012 |
|
Namespace |
|
|
Metadata |
|
See also
Build date: 2/25/2013
