user1428798
user1428798

Reputation: 1546

Hide the small logo in the toast notification windows 8

I'm using this code to show a toastnotifcation in my application:

var toastXml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastImageAndText02);
var image = toastXml.GetElementsByTagName("image")[0];
var title = toastXml.GetElementsByTagName("text")[0];

var text = toastXml.GetElementsByTagName("text")[1];

image.Attributes[1].AppendChild(toastXml.CreateTextNode("ms-appx:///Assets/Images/logovboardnotif.png"));

title.AppendChild(toastXml.CreateTextNode("Board"));

text.AppendChild(toastXml.CreateTextNode(message));


var toastnotifier = ToastNotificationManager.CreateToastNotifier();

var toastnotification = new ToastNotification(toastXml);

toastnotifier.Show(toastnotification);

My problem is when the toast is shown, there's a small logo (azure color): enter image description here

How can I hide this logo?

Upvotes: 2

Views: 1430

Answers (1)

Farhan Ghumra
Farhan Ghumra

Reputation: 15296

UPDATE 1

According to Programming Windows® 8 Apps with HTML, CSS, and JavaScript by Microsoft Press There are no means to override this; the branding attribute in the XML is ignored for toasts.


You have to set branding attributte to none, default is logo. See here try the below given code.

var xml = @"<toast>
                <visual>
                    <binding template=""ToastImageAndText02"" branding=""none"">
                        <image id=""1"" src=""{0}""/>
                        <text id=""1"">{1}</text>
                        <text id=""2"">{2}</text>
                    </binding>  
                </visual>
            </toast>";

xml = string.Format(xml, "ms-appx:///Assets/Images/logovboardnotif.png", "Board", message);
var xmlDoc = new XmlDocument();
xmlDoc.LoadXml(xml);
var toastnotification = new ToastNotification(xmlDoc);
ToastNotificationManager.CreateToastNotifier().Show(toastnotification);

Upvotes: 3

Related Questions