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
Applies to
See also
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for