简体   繁体   English

是否可以在Windows操作中心警报中自定义Toast通知到期?

[英]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. 我正在构建一个服务,以将Windows操作中心通知作为XML有效负载发送。 Client application sitting in Windows machine will receive this notification and show this toast message via Windows Action Center. 位于Windows计算机中的客户端应用程序将收到此通知,并通过Windows操作中心显示此Toast消息。

  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? 默认情况下,此Toast通知将在操作中心停留7天,是否有任何XML标记,通过该标记我可以通过XML有效负载本身自定义Toast通知到期?
  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? 是否有任何XML标记可以指示消息直接显示在Windows操作中心而不是显示为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? 默认情况下,此Toast通知将在操作中心停留7天,是否有任何XML标记,通过该标记我可以通过XML有效负载本身自定义Toast通知到期?

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. 理想情况下,操作中心通知的到期日期为7天,除非在创建Toast期间指定了更早的到期时间。 You could set ExpirationTime property for specific expiration time. 您可以为特定的到期时间设置ExpirationTime属性。

Expires after 30 seconds 30秒后过期

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? 是否有任何XML标记可以指示消息直接显示在Windows操作中心而不是显示为Toast?

Currently, we could not set silent notification for uwp, But I think this is good feature request. 目前,我们无法为uwp设置静默通知,但我认为这是一个很好的功能请求。 Please feel free post this in UserVoice . 请随时在UserVoice中发布此信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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