0

I have found the following link explaining how to display a Toast notification using C#:

https://learn.microsoft.com/en-us/windows/uwp/design/shell/tiles-and-notifications/send-local-toast-desktop

However, on Step 2: Reference the APIs, the Windows.UI and Windows.Data namespaces were not available in the Add Reference wizard. I learned that it is because my project targets the .NET framework, not .NET core. I don't want to convert my entire project to .NET core because I rely on certain NuGet packages that might not be compatible.

How can I display Toast notifications from a WinForms app that targets the .NET framework? I found a nuget wrapper package, but it is for WPF applications.

EDIT: The notification should persist within Windows Action Center.

JohnWick
  • 4,929
  • 9
  • 37
  • 74
  • https://stackoverflow.com/questions/461184/how-to-add-toast-style-popup-to-my-application –  Dec 13 '19 at 22:34
  • @JQSOFT The accepted answer in the question you linked will not persist in the Action Center of Windows 10. – JohnWick Dec 13 '19 at 22:43
  • 2
    I can't see any _Action Center of Windows 10_ in your question. Just tried to help. –  Dec 13 '19 at 22:55
  • 1
    I edited my question to clarify. – JohnWick Dec 13 '19 at 23:01
  • It's really simple in Javascript, call `setTimeout()` on a div element. Why are you doing this on the server and installing packages? Just make a div with some styling. – Train Dec 13 '19 at 23:28
  • @Train Originally, my question title started with C# for clarity, but someone edited it out. Anyways, read my question again and check the tag, this is a WinForms C# application. – JohnWick Dec 13 '19 at 23:32
  • 1
    We usually leave tags out of question titles. – LarsTech Dec 13 '19 at 23:33
  • 2
    Ah sorry I read it as web forms! My mistake. – Train Dec 13 '19 at 23:36
  • Is showing/hiding a separate window with animations acceptable? – Train Dec 13 '19 at 23:39
  • 1
    It might have to be since I am not making a UWP app, although I really want my notifications to be saved within the Windows 10 Action Center. I am leaving this question open for that reason, otherwise @JQSOFT's initial comment would be enough to answer my question I believe. – JohnWick Dec 13 '19 at 23:41
  • 1
    Just found [this](https://github.com/rafallopatka/ToastNotifications) mentioned in a new post and I remembered that you need something like this. Might work for you. Happy new year in advance. –  Dec 27 '19 at 00:08
  • 1
    @JQSOFT Thanks for that, I had seen that github page before, but it's for WPF, not WinForms. Happy 2020 to you, as well. – JohnWick Dec 27 '19 at 06:54

0 Answers0