Basic ToastNotification for the Uno Platform. Shared code works on UWP, Android, WPF, GTK and WASM. This package contains extension functions needed for WebAssembly projects to handle notifications properly.
$ dotnet add package ToastNotification.Uno.WasmBasic ToastNotification for the Uno Platform.
Provides basic, signature-compatible APIs with Microsoft.Toolkit.Uwp.Notifications, for the Uno Platform.
| Package | Version |
|---|---|
| Cross platform | |
| WPF | |
| WASM | |
| GTK |
#if __ANDROID__
var logoSource = new LogoSource(new Uri("ms-appx:///sample.png"));
#else
var logoSource = new LogoSource(new Uri("ms-appx:///Assets/sample.png"));
#endif
logoSource.Dispose();
await new ToastNotification()
.AddAppLogoOverride(logoSource)
.AddText("Toaster with buttons")
.AddText("Hello world!")
.AddText("Wanna play with me?")
.AddButton(new ToastButton()
.SetContent("Let's go!")
.AddArgument("ShouldPlay", true)
)
.AddButton(new ToastButton()
.SetContent("Another time")
.SetDismissActivation()
)
.Show();
Show(ToastNotification toast).