Bonjour, je suis en train d apprendre le C# via visual studio et je suis en train de créer une application qu irais afficher une notification toast sur W10. Je suis parvenu à créer mon toast notification avec ce code
" // template to load for showing Toast Notification
var xmlToastTemplate = "<toast launch=\"app-defined-string\">" +
"<visual>" +
"<binding template =\"ToastGeneric\">" +
"<text>Sample Notification</text>" +
"<text>" +
"This is a sample toast notification from kunal-chowdhury.com" +
"</text>" +
"</binding>" +
"</visual>" +
"</toast>";
// load the template as XML document
var xmlDocument = new XmlDocument();
xmlDocument.LoadXml(xmlToastTemplate);
// create the toast notification and show to user
var toastNotification = new ToastNotification(xmlDocument);
var notification = ToastNotificationManager.CreateToastNotifier();
notification.Show(toastNotification); ""
Dans ce code on script la partie xml ça fonctionne mais moi j aimerait charger un fichier toast xml déjà existant sur mon poste par exemple dans C:\toast.xml.
Je ne parvient pas à trouver la ligne permettant de faire un load xml extérieur à mon projet C#. Pouvez vous m'aider ?
Partager