I have created below toast notification
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");
((XmlElement)toastNode).SetAttribute("type", "Employee");
((XmlElement)toastNode).SetAttribute("launch", "<cat state='angry'><facebite state='true' /></cat>");
ToastNotification toast = new ToastNotification(toastXml);
ToastNotificationManager.CreateToastNotifier().Show(toast);
I want to know how to access the type attribute.
When I tried with below code it's returning null
var att = toast.Content.Attributes;
Debugging shows you the answer.
var att = toast.Content.ChildNodes[0].Attributes[1].NodeValue;