WPF Desktop App, Windows 10 Notification Toast 2016 (UWP Community Toolkit)

烈酒焚心 提交于 2019-12-03 07:12:29

No way of doing this with the UWP Toolkit alone

It looks like with .NET Standard this can only be achieved in two steps, and one of them is out of the scope of the UWP Toolkit.

.NET Standard Apps require a COM Server and a special Start Menu Shortcut to properly use the Windows 10 Action Center. UWP Apps seem to not require or already come with an equivalent functionality. These two steps are supposed to be performed during application installation, and this is obviously something the Microsoft UWP Toolkit takes no part in. Thus the UWP Toolkit alone is not only unable but never will be able to provide a complete solution for displaying Windows 10 Toasts for .NET Standard in a self contained way.

Alternatives

I found an obscure C# Project on Github that has 'Microsoft' in its name, it works out of the box without the UWP Toolkit. It requires you to provide a GUID and an AppID string which then is used to register the COM Server and create the Shortcut.

A cleaner looking alternative is this library which seems to provide the same functionality. I still have to test it.

Both these solutions should work with Microsoft's NotificationsExtensions librabry, which is a precursor of the UWP Toolkit and helps with generating the XML code Toasts are made of.

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