locked
Live tile displaying multiple updates RRS feed

  • Question

  • Hi,

    I am developing Win 8 app where I need to display multiple notifications stored in list of string. However I am not able to figure out why multiple live updates are not queued. Please note I am using Local notification and NOT scheduled/periodic or push notification.

     

    Code:

     var updater = TileUpdateManager.CreateTileUpdaterForApplication();
    updater.EnableNotificationQueue(true);
    
    foreach (string str in lstStr)
    {
         var tile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquareText04);
    
    tile.GetElementsByTagName("text")[0].InnerText = str;
    
    updater.Update(new TileNotification(tile));
    }
    
                

    Please let me know if I am missing anything.

    Thanks.

    Thursday, November 29, 2012 12:58 PM

Answers

  • your code should be good. for showing multple notifications this line should do the trick:

    updater.EnableNotificationQueue(true);

    just be aware you cant show more then 5 notifications


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Proposed as answer by Aaron Xue Tuesday, December 4, 2012 10:35 AM
    • Marked as answer by Aaron Xue Friday, December 7, 2012 8:25 AM
    Thursday, November 29, 2012 1:26 PM

All replies

  • For above case no live update works, however when I tried the below piece of code, still an issue:

                for (int i = 0; i < 5; i++)
                {
                    XmlDocument xmltile = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText04);
                    xmltile.GetElementsByTagName("text")[0].InnerText = "Tile" + i;
                    TileNotification tileupdate = new TileNotification(xmltile);
                    TileUpdateManager.CreateTileUpdaterForApplication().Update(tileupdate);
                }

    only Tile 0 and then Tile 4 is displayed... All strings - Tile 0,Tile 1,Tile 2,Tile 3,Tile 4 are not cycled.
    • Edited by AbhilashShah Thursday, November 29, 2012 1:20 PM
    Thursday, November 29, 2012 1:20 PM
  • your code should be good. for showing multple notifications this line should do the trick:

    updater.EnableNotificationQueue(true);

    just be aware you cant show more then 5 notifications


    Microsoft Certified Solutions Developer - Windows Store Apps Using C#

    • Proposed as answer by Aaron Xue Tuesday, December 4, 2012 10:35 AM
    • Marked as answer by Aaron Xue Friday, December 7, 2012 8:25 AM
    Thursday, November 29, 2012 1:26 PM