How to get notification of an application in Windows 10?

Earlier in Windows Phone 8.1 I used the ToastPromptprovided coding4fun toolkit. These notifications are inside the application and very neat. Is there something similar for Windows 10 UWP. Since I could not use the same. Used code:

ToastPrompt tp = new ToastPrompt() { Title = "Hi", Message = "Show the message" };
tp.Show();

This works on wp 8.1 winrt, but does not work on win10 Universal.

enter image description here

I was looking for something like this that would not appear in the middle of the action, like a normal toast notification. But I realized that this would be nice with respect to universal applications, so I implemented my own local notification. You can check the app here if you want to see what exactly I had in mind.

+4
source share
3 answers

If you want only a simple notification that appears and leaves and remains in your application, I wrote a blog post on how to do it yourself (simple but effective): http://msicc.net/?p=4365 (required about 30 minutes).

0

What you want probably looks like a modal dialog, not a notification. You can use ContentDialog for this . Copying an example from the link below:

using System;
private async void WifiConnectionLost()
{
    ContentDialog noWifiDialog = new ContentDialog()
    {
        Title = "No wifi connection",
        Content = "Check connection and try again",
        PrimaryButtonText = "Ok"
    };

    await noWifiDialog.ShowAsync();
}
0
source

Source: https://habr.com/ru/post/1607093/


All Articles