Niels
Niels

Reputation: 2596

How to change tile title with new Live Tile templates in Windows Phone 8.1 Universal app?

Right now, I'm generating custom tiles for my app. But I'd like to change the title of the tile as well, being dynamically (e.g., I can show the current location).

In WP8 you were able to set the Title and the BackTitle, but these parameters seems to be missing in Universal Apps.

Any idea on how to do this? I think it's only possible to set Branding to BadgeIcon or app Title? I'd like to set the (Front)Title to a string, and back title to nothing.

/// RENDERING THE TILES
string WideFrontTile = await RenderWideFront(WeatherData);
string MediumFrontTile = await RenderMediumFront(WeatherData);
string WideBackTile = await RenderWideBack(WeatherData);
string MediumBackTile = await RenderMediumBack(WeatherData);

// FRONT TILES
ITileWide310x150Image WideFrontContent = TileContentFactory.CreateTileWide310x150Image();
WideFrontContent.Image.Src = WideFrontTile;
ITileSquare150x150Image MediumFrontContent = TileContentFactory.CreateTileSquare150x150Image();
MediumFrontContent.Image.Src = MediumFrontTile;
WideFrontContent.Square150x150Content = MediumFrontContent;

// BACK TILES
ITileWide310x150Image WideBackContent = TileContentFactory.CreateTileWide310x150Image();
WideBackContent.Image.Src = WideBackTile;
ITileSquare150x150Image MediumBackContent = TileContentFactory.CreateTileSquare150x150Image();
MediumBackContent.Image.Src = MediumBackTile;
WideBackContent.Square150x150Content = MediumBackContent;


// Clear all tiles, push new tiles
TileUpdateManager.CreateTileUpdaterForApplication().Clear();
TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
TileUpdateManager.CreateTileUpdaterForApplication().Update(WideBackContent.CreateNotification());
TileUpdateManager.CreateTileUpdaterForApplication().Update(WideFrontContent.CreateNotification());

Kind regards, Niels

Upvotes: 2

Views: 693

Answers (1)

Cabuxa.Mapache
Cabuxa.Mapache

Reputation: 771

Just set the attribute "branding":

    var TileMgr = TileUpdateManager.CreateTileUpdaterForApplication();
    TileMgr.Clear();
    var tileTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Image);

    // Quitamos el nombre de la app.
    XmlElement tmp = tileTemplate.GetElementsByTagName("visual")[0] as XmlElement;
    tmp.SetAttribute("branding", "none");
    var notification = new TileNotification(tileTemplate);
    TileMgr.Update(notification);

Upvotes: 1

Related Questions