locked
When I use EnableNotificationQueue(true),Can I get index i value is fix and can,t change? RRS feed

  • Question

  • Dear All:

    When I used notification queue  is enabled "EnableNotificationQueue(true)" ,a maximum of five tile notifications can automatically cycle on the tile,but  why below index i value first show is 4,3,2,1,0 then secondary,third change to 0,1,2,3,4 on the tile?

    How can get first,secindry... index i  value is 0,1,2,3,4 on the tile? 

    code:

    TileUpdateManager.CreateTileUpdaterForApplication().EnableNotificationQueue(true);
    for (int i = 0; i < 5; i++)
    {
     var template = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText03);
            var tileAttributes = template.GetElementsByTagName("text")[0];
            tileAttributes.AppendChild(template.CreateTextNode("show index :  " + i));
            var tileNotification = new TileNotification(template);
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
    }


    • Edited by Jessedna Monday, April 16, 2012 9:30 AM
    Monday, April 16, 2012 9:26 AM

All replies

  • Hi Jesse,

    I do not understand what you are asking.  Could you provide more information?

    -Jeff


    Jeff Sanders (MSFT)

    Tuesday, April 17, 2012 2:44 PM
    Moderator
  • Hi,Jpsanders

    This program will show off the value of i on the Metro UI

    ,When I use EnableNotificationQueue (true);
     

    You will find that first queue came out i value is upside down on the metro

    First run : value :show index: 4,show index: 3,show index: 2,show index: 1,show index: 0

    The second queue run out of i values ​​is normal

    Second run : value :show index: 0,show index: 1,show index: 2,show index: 3,show index: 4

    for (int i = 0; i < 5; i++)
    {
     var template = TileUpdateManager.GetTemplateContent(TileTemplateType.TileWideText03);
            var tileAttributes = template.GetElementsByTagName("text")[0];
            tileAttributes.AppendChild(template.CreateTextNode("show index :  " + i));
            var tileNotification = new TileNotification(template);
            TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);
    }

    i want to ask when i run this loop,how to make i value is normal,not upside down?

    ex:

    First queue run : value :show index: 0,show index: 1,show index: 2,show index: 3,show index: 4

    Second queue run : value :show index: 0,show index: 1,show index: 2,show index: 3,show index: 4

    Wednesday, April 18, 2012 6:30 AM
  • You code is not correct.  For javascript it would look like this (you are posting in the Javascript/HTML5 forum):

     var tileUpdateManager = Windows.UI.Notifications.TileUpdateManager
            for (var i = 0; i < 5; i++)
            {
                var template = Windows.UI.Notifications.TileUpdateManager.getTemplateContent(Windows.UI.Notifications.TileTemplateType.tileWideText03);
                var tileAttributes = template.getElementsByTagName("text")[0];
                tileAttributes.appendChild(template.createTextNode("show index :  " + i));
                var tileNotification = new Windows.UI.Notifications.TileNotification(template);
                Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().update(tileNotification);
            }

    What you should see after your code runs is the last update you sent (show index: 4), because you are overwriting the previous updates one after the other.

    When I run this code in a sample javascript app, that is indeed what I see!

    -Jeff


    Jeff Sanders (MSFT)

    Thursday, April 19, 2012 6:57 PM
    Moderator
  • Hi,Jpsanders

    This Metro Style app using C#

    thanks


    Monday, April 23, 2012 6:56 AM