Battery.FromIdAsync(String) Method
Definition
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.
public:
static IAsyncOperation<Battery ^> ^ FromIdAsync(Platform::String ^ deviceId);
/// [Windows.Foundation.Metadata.RemoteAsync]
static IAsyncOperation<Battery> FromIdAsync(winrt::hstring const& deviceId);
[Windows.Foundation.Metadata.RemoteAsync]
public static IAsyncOperation<Battery> FromIdAsync(string deviceId);
function fromIdAsync(deviceId)
Public Shared Function FromIdAsync (deviceId As String) As IAsyncOperation(Of Battery)
Parameters
Returns
A Battery object that corresponds to the specified battery controller.
- Attributes
Remarks
FromIdAsync will return null if the battery controller does not exist and the deviceId value is well-formed. If the deviceId value is not well-formed, such as "AggregateBattery
," then the method will fail with STATUS_OBJECT_NAME_INVALID
.
You can use a DeviceInformation object for a battery controller to use that object's Id property value as the deviceId parameter in FromIdAsync to create a Battery object