Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
public partial class BadgeUpdater
{
private const string JsType = "Windows.UI.Notifications.BadgeUpdater";
partial void SetBadge(string? value)
{
if (int.TryParse(value, out var number))
{
WebAssemblyRuntime.InvokeJS($"{JsType}.setNumber({number})");
}
else
{
WebAssemblyRuntime.InvokeJS($"{JsType}.clear()");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment