烤面包通知按钮将赢得表演
我有一个敬酒通知,需要具有警报的优先级。我找到了一种方法,但是无法测试它,因为我必须添加一个按钮,否则它仍然可以将通知作为正常通知处理。我添加了按钮部分,但不会显示。
这就是我为吐司通知的模板写的:
param(
[String] $Title = 'Citrix Workspace'
)
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
$DEP = 'ICT'
$template = @"
<toast scenario="alarm">
<visual>
<binding template="ToastText04">
<text id="1">$($Title)</text>
<text id="2">Citrix Workspace will close and update in 5 minutes! Save your progress.</text>
</binding>
</visual>
<actions>
<action
activationType="system"
arguments="OK" content=""/>
</actions>
</toast>
"@
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($template)
$toast = New-Object Windows.UI.Notifications.ToastNotification $xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($DEP).Show($toast)
我不知道为什么这不起作用。如果有人有一个想法,或者您需要额外的信息,请告诉我。 非常感谢!!
I have a toast notification that needs to have the priority of an alarm. I have found a way of doing that but haven't been able to test this as I have to add a button or otherwise it will still handle the notification as a normal one. I have added the button part but it won't show up.
This is what I have written for the template of my toast notification:
param(
[String] $Title = 'Citrix Workspace'
)
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.UI.Notifications.ToastNotification, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
$DEP = 'ICT'
$template = @"
<toast scenario="alarm">
<visual>
<binding template="ToastText04">
<text id="1">$($Title)</text>
<text id="2">Citrix Workspace will close and update in 5 minutes! Save your progress.</text>
</binding>
</visual>
<actions>
<action
activationType="system"
arguments="OK" content=""/>
</actions>
</toast>
"@
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
$xml.LoadXml($template)
$toast = New-Object Windows.UI.Notifications.ToastNotification $xml
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier($DEP).Show($toast)
I have no idea why this won't work. If anyone has an idea or if you need extra info just let me know.
Thanks so much!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论