P
pablo_1975
Guest
Hi!
I managed to show a toast notifier in a standard console C# application. The function is like this:
static void ShowImageToast(string appId, string title, string message, string image)
{
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(
ToastTemplateType.ToastImageAndText02);
// Fill in the text elements
XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
stringElements[0].AppendChild(toastXml.CreateTextNode(title));
stringElements[1].AppendChild(toastXml.CreateTextNode(message));
// Specify the absolute path to an image
String imagePath = "file:///" + image;
XmlNodeList imageElements = toastXml.GetElementsByTagName("image");
imageElements[0].Attributes.GetNamedItem("src").NodeValue = imagePath;
// Create the toast and attach event listeners
ToastNotification toast = new ToastNotification(toastXml);
ToastEvents events = new ToastEvents();
toast.Activated += events.ToastActivated;
toast.Dismissed += events.ToastDismissed;
toast.Failed += events.ToastFailed;
ToastNotificationManager.CreateToastNotifier(appId).Show(toast);
}
The problem is that the Application ID appears at the bottom of the toast.
I know there is a branding XML modifier (for the visual and the binding nodes) and if you set it to "none" then it should be hidden but it's not working.
Is there any way to achieve this?
Thanks
Continue reading...
I managed to show a toast notifier in a standard console C# application. The function is like this:
static void ShowImageToast(string appId, string title, string message, string image)
{
XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(
ToastTemplateType.ToastImageAndText02);
// Fill in the text elements
XmlNodeList stringElements = toastXml.GetElementsByTagName("text");
stringElements[0].AppendChild(toastXml.CreateTextNode(title));
stringElements[1].AppendChild(toastXml.CreateTextNode(message));
// Specify the absolute path to an image
String imagePath = "file:///" + image;
XmlNodeList imageElements = toastXml.GetElementsByTagName("image");
imageElements[0].Attributes.GetNamedItem("src").NodeValue = imagePath;
// Create the toast and attach event listeners
ToastNotification toast = new ToastNotification(toastXml);
ToastEvents events = new ToastEvents();
toast.Activated += events.ToastActivated;
toast.Dismissed += events.ToastDismissed;
toast.Failed += events.ToastFailed;
ToastNotificationManager.CreateToastNotifier(appId).Show(toast);
}
The problem is that the Application ID appears at the bottom of the toast.
I know there is a branding XML modifier (for the visual and the binding nodes) and if you set it to "none" then it should be hidden but it's not working.
Is there any way to achieve this?
Thanks
Continue reading...