0
我想创建定期托管通知,但我找到了一个不正确的解决方案,因为snoozeInterva只是一个“延期”。定期预约toastnotification UWP
代码:
public sealed partial class MainPage : Page
{
const string TOAST = @"
<toast>
<visual>
<binding template=""ToastTest"">
<text>Hello Toast</text>
</binding>
</visual>
<audio src =""ms-winsoundevent:Notification.Mail"" loop=""true""/>
</toast>";
public MainPage()
{
this.InitializeComponent();
}
private void btnNotification_Click(object sender, RoutedEventArgs e)
{
var when = DateTime.Now.AddSeconds(6);
var offset = new DateTimeOffset(when);
Windows.Data.Xml.Dom.XmlDocument xml = new Windows.Data.Xml.Dom.XmlDocument();
xml.LoadXml(TOAST);
ScheduledToastNotification toast = new ScheduledToastNotification(xml, offset, TimeSpan.FromSeconds(60), 5);
toast.Id = "IdTostone";
toast.Tag = "NotificationOne";
ToastNotificationManager.CreateToastNotifier().AddToSchedule(toast);
}
}
的话..我怎么能在13:00创建定期Toast通知,例如每天?
在此先感谢!
我想问即使有点平庸...你喜欢Windows的应用程序时,重复平日报警的结构这样一个问题?我请他澄清这些想法。感谢您的帮助.. – LightGreen
@LightGreen是的,我认为这很好。也许不完美。 –
再次感谢您的帮助.. – LightGreen