Skip to content

Instantly share code, notes, and snippets.

@0x414c49
Created January 20, 2020 14:33
Show Gist options
  • Save 0x414c49/f6452e393c2725ab4de66ee60b659983 to your computer and use it in GitHub Desktop.
Save 0x414c49/f6452e393c2725ab4de66ee60b659983 to your computer and use it in GitHub Desktop.
Sample sensor using in BlazorMobileBindings
<StackLayout Orientation="StackOrientation.Horizontal"
HorizontalOptions="LayoutOptions.Center">
<Label Text="@("Battery level is " + Battery.ToString())"
FontAttributes="FontAttributes.Bold"
VerticalTextAlignment="TextAlignment.Center" />
</StackLayout>
@code
{
double Battery
{
get => Xamarin.Essentials.Battery.ChargeLevel;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment