Using Interactive Toast Notifications with a old WPF Project

I have a working program which opens Dialog Boxes(WPF) for User input . Now i want to Refactor and use Toast Notifications. The Notifications need to have the ability of Buttons (Pressing yes or no). The new Win10 interactive Toast Notification seemd perfect. I got the official tutorial from Windows. https://docs.microsoft.com/en-us/windows/uwp/controls-and-patterns/tiles-and-notifications-send-local-toast

Displaying the Toasts works fine but.... The Programm is a in Visual Studio WPF App(.NET Framework) written in C#. It won't allow me to override methods in my App.xaml.cs i need like:

protected override void OnActivated(IActivatedEventArgs e)
protected override async void OnBackgroundActivated(BackgroundActivatedEventArgs args)

"There is no suitable Method for override" Simply because there is none ...i think?!

As soon as i tried with a new Project "Blank App univeral Windows" exept from "WPF App .NET Framework" overriting is no problem. Also new created WPF Apps won't let me override.

So my question. What can i do to still use interactive Toasts with my WPF Project? Or is there a alternative way of doing it?

链接地址: http://www.djcxy.com/p/51242.html

上一篇: 由于它可以做什么或因为它做什么而关闭

下一篇: 在旧的WPF项目中使用交互式Toast通知