Introduction

Procedures

- <code>
- private void simpleToast_Click(object sender, RoutedEventArgs e)
- {
- ToastTemplateType toastType = ToastTemplateType.ToastText02;
- XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastType);
- XmlNodeList toastTextElement = toastXml.GetElementsByTagName("text");
- toastTextElement[0].AppendChild(toastXml.CreateTextNode("Hello C# Corner"));
- toastTextElement[1].AppendChild(toastXml.CreateTextNode("I am poping you from a Winmdows Phone App"));
- IXmlNode toastNode= toastXml.SelectSingleNode("/toast");
- ((XmlElement)toastNode).SetAttribute("duration","long");
- ToastNotification toast = new ToastNotification(toastXml);
- ToastNotificationManager.CreateToastNotifier().Show(toast);
- }
- </code>
Before you start, ensure you have the following namespace in your project.
- using Windows.UI.Notifications;
- using Windows.Data.Xml.Dom;
Output
It's a small demonstration of Toast Notification that we have implemented with the help of the Windows Phone 8.1 API.

Note
You must have Visual Studio 2013 Update 2 at least with the Windows Phone 8.1 Emulator or any supported device to run this demo app.


Eslam MahmoudPosted Dec 6, 2016, 1:28 AM EST
How i can make Auto Notifications show every 5 hour ?
Mohammad TuahaPosted Oct 25, 2015, 7:22 AM EDT
using Windows.UI.Notifications; using Windows.Data.Xml.Dom; those name space are not in reference . please help me
Mohammad TuahaPosted Oct 20, 2015, 10:27 AM EDT
Can any one tell is it support windows phone 8.0. It's not supporting on VS 2013.
Bridin McDermottPosted Apr 2, 2015, 4:58 PM EDT
Have you a tutorial on windows phone 8.1 connecting to a Web API?
Abhishek Kumar RaviPosted Jan 20, 2015, 7:06 AM EST
You can refer to this : http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868254.aspx
Abhishek JainPosted Jan 20, 2015, 1:24 AM EST
How do I do it in WinRT non silverlight app for WP8.1?
Viraj ShahPosted Nov 16, 2014, 7:50 PM EST
nice one,good job!!