您好使用以下代碼,活瓷磚工作正常,但是我發現小徽標總是存在於瓷磚的左下方,我該如何擺脫它?看到this在窗戶中的活瓷磚8隱藏小徽標圖像
XmlDocument tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideImageAndText01);
XmlDocument squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquarePeekImageAndText01);
XmlNodeList textElements = tileXml.GetElementsByTagName("text");
textElements[0].AppendChild(tileXml.CreateTextNode(_serviceOrderItems.Count.ToString()));
XmlNodeList imageElements = tileXml.GetElementsByTagName("image");
XmlElement imageElement = (XmlElement)imageElements[0];
imageElement.SetAttribute("src", "ms-appx:///Assets/Image310X150.jpg");
imageElement.SetAttribute("alt", "Aker Solutions");
XmlNodeList squareImageElements = squareTileXml.GetElementsByTagName("image");
XmlElement squareImageElement = (XmlElement)squareImageElements.Item(0);
squareImageElement.SetAttribute("src", "ms-appx:///Assets/Image150X150.jpg");
squareImageElement.SetAttribute("alt", "Aker Solutions");
IXmlNode subnode = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding")[0], true);
tileXml.GetElementsByTagName("visual")[0].AppendChild(subnode);
TileNotification tile = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tile);
這個問題是http://stackoverflow.com/a/12331465/1656796的變體。將視覺元素上的品牌屬性設置爲「無」(應用於正方形和寬度內容)或綁定元素。 – 2013-03-07 17:07:57
Thanks Nathan,增加以下行 XmlElement visualElement = tileXml.GetElementsByTagName(「visual」)[0] as XmlElement; visualElement.SetAttribute(「品牌」,「無」); – 2013-03-07 18:28:39