Answer the question
In order to leave comments, you need to log in
What is the correct way to call toast notifications in a Windows Forms project?
Hello,
I can not find any sane information on how to use toast notifications in a Windows Forms project.
Tried through NotificationsExtensions.Win10, but messages are not shown. I understand that the application must first be registered in the system somehow, but I do not understand how.
Here is how I create notification:
private void Button_Click(object sender, RoutedEventArgs e)
{
ToastContent toastContent = new ToastContent()
{
Visual = new ToastVisual()
{
BindingGeneric = new ToastBindingGeneric()
{
Children =
{
new AdaptiveText()
{
Text = "Hello world!"
}
}
}
}
};
var doc = new XmlDocument();
doc.LoadXml(toastContent.GetContent());
var toast = new ToastNotification(doc);
ToastNotificationManager.CreateToastNotifier("Test").Show(toast);
}
Answer the question
In order to leave comments, you need to log in
The problem lay in the fact that you need to create a program shortcut in the Start Menu with the given parameters: AppUserModel.ID and ToastActivatorCLSID .
Link times
Link 2
Link 3
In general, learn to search for information in English (there will be more information)
Ideally, without any libraries, toast can be used in UWP. That's where you're going.)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question