如何使用WMS在Windows Phone 8.1 Silverlight应用程序中为磁贴设置空标题?
如果没有WMS,我可以在DisplayName
中将WMAppManifest.xml
设置为空字符串并且它有效。使用WMS,我无法再将DisplayName
设置为Package.appxmanifest
中的空字符串,因此应用标题始终显示在中等磁贴上,我不想在那里显示。
答案 0 :(得分:1)
事实上它并不相同。默认情况下,您将显示应用标题。但是当您使用TileUpdateManager更新磁贴时,您可以删除标题。检查"品牌"属性设置为"无"
var tileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWidePeekImageAndText01);
var tileImageAttributes = tileXml.GetElementsByTagName("image");
((XmlElement)tileImageAttributes[0]).SetAttribute("src", "ms-appdata:///local" + wideBackGroundUri.LocalPath);
var brandingAttribute = tileXml.GetElementsByTagName("binding");
((XmlElement)brandingAttribute[0]).SetAttribute("branding", "none");
tileXml.SelectSingleNode("//text[@id=1]").InnerText = wideBackContent;
TileNotification tileNotification = new TileNotification(tileXml);
TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
在new TileNotification
之前,您可以添加以下代码。
var squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquarePeekImageAndText04);
var squareTileXmlAttributes = squareTileXml.GetElementsByTagName("image");
((XmlElement)squareTileXmlAttributes[0]).SetAttribute("src", "ms-appdata:///local" + backGroundUri.LocalPath);
var brandingSquareAttribute = squareTileXml.GetElementsByTagName("binding");
((XmlElement)brandingSquareAttribute[0]).SetAttribute("branding", "none");
squareTileXml.SelectSingleNode("//text[@id=1]").InnerText = backContent;
IXmlNode node = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding").Item(0), true);
tileXml.GetElementsByTagName("visual").Item(0).AppendChild(node);