The following forum(s) have migrated to Microsoft Q&A (Preview): Developing Universal Windows apps!
Visit Microsoft Q&A (Preview) to post new questions.

Learn More

Multiple Live Tile Update RRS feed

  • Question

  • Hello,

    I am working on a method which has all three tiles ready on user's choice. I think I am Close to get this working, but I can't figure out how to construct the XML payload for the tile notification, any ideas?

    public void UpdateTiles(string smallTileImagePath, string mediumTileImagePath, string wideTileImagePath)
                var tileUpdater = TileUpdateManager.CreateTileUpdaterForApplication();
                var smallTileTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare71x71Image);
                var smallTileImageAttributes = smallTileTemplate.GetElementsByTagName("image");
                ((XmlElement)smallTileImageAttributes.Item(0)).SetAttribute("src", smallTileImagePath);
                var mediumTileTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Image);
                var mediumTileImageAttributes = mediumTileTemplate.GetElementsByTagName("image");
                ((XmlElement)mediumTileImageAttributes.Item(0)).SetAttribute("src", mediumTileImagePath);
                var wideTileTemplate = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWide310x150Image);
                var wideTileImageAttributes = wideTileTemplate.GetElementsByTagName("image");
                ((XmlElement)wideTileImageAttributes.Item(0)).SetAttribute("src", wideTileImagePath);
                var xmlPayload = ?
                var notification = new TileNotification(xmlPayload);

    Friday, February 6, 2015 3:31 PM


  • Read this document carefully:

    This example defines a text-only medium notification using the same text string that we used in the wide notification.

    XmlDocument squareTileXml = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquare150x150Text04);
    XmlNodeList squareTileTextAttributes = squareTileXml.GetElementsByTagName("text");
    squareTileTextAttributes[0].AppendChild(squareTileXml.CreateTextNode("Hello World! My very own tile notification"));

    Next, add the medium tile to the wide tile's payload. Retrieve the binding element that defines the medium tile in the squareTileXml payload. Append that binding element as a sibling of the wide tile.

    IXmlNode node = tileXml.ImportNode(squareTileXml.GetElementsByTagName("binding").Item(0), true);

    The preceding steps result in two binding elements under a single visual element in the XML payload, as shown here:

        <visual version="2">
            <binding template="TileWide310x150ImageAndText01" fallback="TileWideImageandText01">
                <image id="1" src="ms-appx:///assets/redWide.png"/>
                <text id="1">Hello World! My very own tile notification</text>
            <binding template="TileSquare150x150Text04" fallback="TileSquareText04">
                <text id="1">Hello World! My very own tile notification</text>

    Best Regards,
    Please remember to mark the replies as answers if they help

    Monday, February 9, 2015 6:50 AM