/// <inheritdoc/> public async Task <string> ShowNotificationAsync(NotificationContent content) { var notification = new ToastNotification(content.GetXml()); string tag = Guid.NewGuid().ToString(); notification.Tag = tag; notification.Group = "Toasts"; ToastNotifier.Show(notification); return(tag); }
/// <inheritdoc/> public async Task <string> ShowAlarmAsync(NotificationContent content, DateTimeOffset showTime) { var notification = new ScheduledToastNotification(content.GetXml(), showTime); string tag = Guid.NewGuid().ToString(); notification.Tag = tag; notification.Group = "Alarms"; ToastNotifier.AddToSchedule(notification); return(tag); }
public static XmlDocument GetXml(this NotificationContent content) { var builder = new ToastContentBuilder(); builder.AddText(content.Title, AdaptiveTextStyle.Title); foreach (var l in content.Body) { builder.AddText(l, AdaptiveTextStyle.Body); } return(builder.Content.GetXml()); }