[UWP]与桌面应用程序中的Toast Notifications进行交互 [英] [UWP]Interact with Toast Notifications from Desktop Application

查看:79
本文介绍了[UWP]与桌面应用程序中的Toast Notifications进行交互的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我有一个桌面应用程序,它正在成功创建Toast通知。我添加了两个动作按钮。我的主要问题是如何与这些按钮进行交互?


在测试UWP应用程序上,它在OnActivate中相对容易,但不知道如何从Windows窗体应用程序继续。



提前致谢

解决方案

< blockquote>

你可以处理ToastNotification的Activated事件:

 ToastNotification toast = new ToastNotification(toastXml); 
toast.Activated + = ToastActivated;


private void ToastActivated(ToastNotification sender,object args)
{
var toastActivationArgs = args as ToastNotificationActivatedEventArgs;
// ... ...
}

希望有所帮助。


请记住通过将有用的帖子标记为答案来关闭您的主题,然后如果您有新问题则启动新主题。请不要在同一个帖子中提出几个问题。


Hi,

I have a desktop application whish is succesfully creating Toast notifications. I've added two buttons for actions. My main problem is how can I interact with these buttons?

On a test UWP app it was relativelly easy usin OnActivate but don't know how to proceed from a Windows Form application.

Thanks in advance

解决方案

You could handle the Activated event of the ToastNotification:

            ToastNotification toast = new ToastNotification(toastXml); 
            toast.Activated += ToastActivated; 


private void ToastActivated(ToastNotification sender, object args)
        {
            var toastActivationArgs = args as ToastNotificationActivatedEventArgs;
            //...
        }

Hope that helps.

Please remember to close your threads by marking helpful posts as answer and then start a new thread if you have a new question. Please don't ask several questions in the same thread.


这篇关于[UWP]与桌面应用程序中的Toast Notifications进行交互的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆