C#WPF Toastnotifications snooze后
我在Visual Studio 2022中创建了一个C#WPF Windows应用程序。
该应用程序在按钮上按下按钮,按下“重要”,然后将其解散。 当使用贪睡按钮时,时间已经过去了,并再次显示通知,然后,现在的事件按钮并按下文本“重要”不像以前那样行为。
它以“ - 抗激活的 - 装饰”为论点进入了Onstartup,没有关于按钮还是按下的文字的信息?
我在这里错过了什么如何分开贪睡?
一些sourcecode:
protected override void OnStartup(StartupEventArgs sea)
{
if (sea.Args.Count() > 0)
{
String s = "args:";
foreach (var item in sea.Args)
s = s + "<" + item + ">";
if (sea.Args[0] == "RKToast.xml")
{
ShowNotification();
}
else
if (sea.Args[0] == "-ToastActivated" && sea.Args[1] == "-Embedding")
{
MessageBox.Show($"ToastAction after snooze:\r\n{s}");
}
在示威化中:
notification = new ToastNotification(xmlDocument);
notification.Activated += ToastActivated;
notification.Dismissed += ToastDismissed;
notification.Failed += ToastFailed;
...
xmldocument很简单
<toast scenario="reminder">
<visual>
<binding template="ToastGeneric">
<text>Text....</text>
<group>
<subgroup>
<text hint-align="center" hint-style="title">IMPORTANT</text>
</subgroup>
</group>
</binding>
</visual>
<actions>
<input id="snoozeTime" type="selection" defaultInput="1">
<selection id="1" content="1 minut"/>
<selection id="15" content="15 minuter"/>
<selection id="60" content="1 time"/>
</input>
<action content="Now" arguments="action=[EXECUTE]" activationType="background"/>
<action content="Later" arguments="snooze" activationType="system" hint-inputId="snoozeTime"/>
</actions>
</toast>
I created a C# WPF windows app in Visual Studio 2022
The app handles press on buttons, press on "Important" and dismiss just fine.
When using the Snooze button, the time has passed and the notification is shown again, then the events Now button and pressing on the text "Important" does not behave as before.
It comes into the OnStartup with argument of "-ToastActivated -Embedding" and no information about if it was the button or the text that was pressed?
What am I missing here how to tell events apart after snooze?
Some of the sourcecode:
protected override void OnStartup(StartupEventArgs sea)
{
if (sea.Args.Count() > 0)
{
String s = "args:";
foreach (var item in sea.Args)
s = s + "<" + item + ">";
if (sea.Args[0] == "RKToast.xml")
{
ShowNotification();
}
else
if (sea.Args[0] == "-ToastActivated" && sea.Args[1] == "-Embedding")
{
MessageBox.Show(quot;ToastAction after snooze:\r\n{s}");
}
In ShowNotification:
notification = new ToastNotification(xmlDocument);
notification.Activated += ToastActivated;
notification.Dismissed += ToastDismissed;
notification.Failed += ToastFailed;
...
xmlDocument is simple
<toast scenario="reminder">
<visual>
<binding template="ToastGeneric">
<text>Text....</text>
<group>
<subgroup>
<text hint-align="center" hint-style="title">IMPORTANT</text>
</subgroup>
</group>
</binding>
</visual>
<actions>
<input id="snoozeTime" type="selection" defaultInput="1">
<selection id="1" content="1 minut"/>
<selection id="15" content="15 minuter"/>
<selection id="60" content="1 time"/>
</input>
<action content="Now" arguments="action=[EXECUTE]" activationType="background"/>
<action content="Later" arguments="snooze" activationType="system" hint-inputId="snoozeTime"/>
</actions>
</toast>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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