Get protocol activation args in “Project Centennial” app

浪尽此生 提交于 2019-12-10 12:16:15

问题


How can I access the protocol activation arguments in a Winforms app that's converted into a UWP app?

The problem is that the OnActivated method is absent so I can't get the IActivatedEventArgs.


回答1:


I'm assuming you want to handle file types in which case you can check Environment.GetCommandLineArgs() as normal for arguments. The second argument will be the file or protocol activated.




回答2:


How can I access the protocol activation arguments in a Winforms app that's converted into a UWP app?

The lifecycle can't be integrated in Converted UWP app. Basically the common scenarios are enabling Toast notification, Live tile, App service and Background task.

Please check Supported UWP APIs for converted desktop apps

Some official samples: DesktopBridgeToUWP-Samples



来源:https://stackoverflow.com/questions/39436602/get-protocol-activation-args-in-project-centennial-app

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!