烤面包通知按钮将赢得表演

发布于 2025-01-24 20:40:53 字数 1302 浏览 5 评论 0原文

我有一个敬酒通知,需要具有警报的优先级。我找到了一种方法,但是无法测试它,因为我必须添加一个按钮,否则它仍然可以将通知作为正常通知处理。我添加了按钮部分,但不会显示。

这就是我为吐司通知的模板写的:

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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文