Inclinometer.GetDefault Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
GetDefault() |
Returns the default inclinometer for absolute readings. |
GetDefault(SensorReadingType) |
Returns the default inclinometer based on the SensorReadingType. |
Returns the default inclinometer for absolute readings.
public:
static Inclinometer ^ GetDefault();
static Inclinometer GetDefault();
public static Inclinometer GetDefault();
function getDefault()
Public Shared Function GetDefault () As Inclinometer
Returns
The default inclinometer or null if no inclinometers are found.
Examples
The following example demonstrates how a UWP app built with XAML and C# used this method to establish a connection to the default inclinometer.
_inclinometer = Inclinometer.GetDefault();
Remarks
This method returns the same result as GetDefault(SensorReadingType.Absolute)
This method only returns values for hardware that has been integrated into the computer by the manufacturer. (The inclinometer readings are derived from multiple sensors.) 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.
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |
Returns the default inclinometer based on the SensorReadingType.
public:
static Inclinometer ^ GetDefault(SensorReadingType sensorReadingtype);
/// [Windows.Foundation.Metadata.Overload("GetDefaultWithSensorReadingType")]
static Inclinometer GetDefault(SensorReadingType const& sensorReadingtype);
[Windows.Foundation.Metadata.Overload("GetDefaultWithSensorReadingType")]
public static Inclinometer GetDefault(SensorReadingType sensorReadingtype);
function getDefault(sensorReadingtype)
Public Shared Function GetDefault (sensorReadingtype As SensorReadingType) As Inclinometer
Parameters
- sensorReadingtype
- SensorReadingType
The type of sensor to retrieve.
Returns
The default inclinometer or null if no inclinometers are found.
- Attributes
Windows requirements
Device family |
Windows 10 Anniversary Edition (introduced in 10.0.14393.0)
|
API contract |
Windows.Foundation.UniversalApiContract (introduced in v3.0)
|
Remarks
This method only returns values for hardware that has been integrated into the computer by the manufacturer. (The inclinometer readings are derived from multiple sensors.) 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.
See also
Applies to
WinRT Build 26100 and other versions
Product | Versions |
---|---|
WinRT | Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |