mirror of
https://github.com/PacktPublishing/Learn-WinUI-3-Second-Edition.git
synced 2026-06-20 12:23:09 +00:00
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using Microsoft.UI.Xaml.Controls;
|
|
using MyMediaCollection.Views;
|
|
|
|
namespace MyMediaCollection.Helpers
|
|
{
|
|
public class NotificationShared
|
|
{
|
|
public const string scenarioTag = "scenarioId";
|
|
|
|
public struct Notification
|
|
{
|
|
public string Originator;
|
|
public string Action;
|
|
public bool HasInput;
|
|
public string Input;
|
|
};
|
|
|
|
public static void CouldNotSendToast()
|
|
{
|
|
MainPage.Current.NotifyUser("Could not send toast", InfoBarSeverity.Error);
|
|
}
|
|
|
|
public static void ToastSentSuccessfully()
|
|
{
|
|
MainPage.Current.NotifyUser("Toast sent successfully!", InfoBarSeverity.Success);
|
|
}
|
|
|
|
public static void AppLaunchedFromNotification()
|
|
{
|
|
MainPage.Current.NotifyUser("App launched from notifications", InfoBarSeverity.Informational);
|
|
}
|
|
|
|
public static void NotificationReceived()
|
|
{
|
|
MainPage.Current.NotifyUser("Notification received", InfoBarSeverity.Informational);
|
|
}
|
|
|
|
public static void UnrecognizedToastOriginator()
|
|
{
|
|
MainPage.Current.NotifyUser("Unrecognized Toast Originator or Unknown Error", InfoBarSeverity.Error);
|
|
}
|
|
}
|
|
} |