简体   繁体   中英

Is it possible to customize toast notification expiration in Windows Action Center alert?

I am building a service to send Windows Action Center notification as a XML payload. Client application sitting in Windows machine will receive this notification and show this toast message via Windows Action Center.

  1. By default this toast notification will stay in action center for 7 days, is there any XML tag through which I can customize the toast notification expiration through XML payload itself?
  2. Is there any XML tag by which I can direct the message to directly appear in Windows Action Center instead of appearing as a toast?

By default this toast notification will stay in action center for 7 days, is there any XML tag through which I can customize the toast notification expiration through XML payload itself?

Ideally an expiration date for a notification in the action center is 7 days, unless an earlier expiration time is specified during the creation of the toast. You could set ExpirationTime property for specific expiration time.

Expires after 30 seconds

var toastNotif = new ToastNotification(toastContent.GetXml());
toastNotif.ExpirationTime = DateTimeOffset.Now + TimeSpan.FromSeconds(30);

Is there any XML tag by which I can direct the message to directly appear in Windows Action Center instead of appearing as a toast?

Currently, we could not set silent notification for uwp, But I think this is good feature request. Please feel free post this in UserVoice .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM