Reputation: 16361
How do use set an empty title for a tile in a Windows Phone 8.1 Silverlight app with WMS?
Without WMS, I could just set the DisplayName
to empty string in WMAppManifest.xml
and it worked. With WMS, I can no longer set DisplayName
to an empty string in Package.appxmanifest
so the app title is always shown on the medium tile and I do not want to shown there.
Upvotes: 0
Views: 212
Reputation: 931
In fact it's not the same. By default you'll have the app title displayed. But when you update the tile with TileUpdateManager you can remove the title. Check the "branding" attribute set to "none"
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);
Just before the new TileNotification
you can add the following code.
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);
Upvotes: 1