locked
Need help in metro style tiles TileWideImage template RRS feed

  • Question

  • Hi, how to add multiple images to TileWideImage template of tiles?

    im using the following code

    var Notifications = Windows.UI.Notifications;

    Windows.UI.Notifications.TileUpdateManager.createTileUpdaterForApplication().enableNotificationQueue(true);

    var tileXml = Notifications.TileUpdateManager.getTemplateContent(Notifications.TileTemplateType.TileWideImage);

     var tileImageAttributes = tileXml.getElementsByTagName("image");
                    tileImageAttributes[0].setAttribute("src", "ms-appx:///images/clouds.jpg");

    How to add more images here ^^^ ?

    Thanks in advance!

    Monday, March 19, 2012 5:49 PM

Answers

All replies

  • Hi,

    For TileWideImage template, only one wide image is allowed.

    If you want to use multiple images, please select TileWideImageCollection, TileWidePeekImageCollection01, or similar template. For example, TileWideImageCollection allows one large square image with four smaller square images.

    The following is a sample tile content for TileWideImageCollection.

     <tile>
      <visual lang="en-US">
        <binding template="TileWideImageCollection">
          <image id="1" src=""/>
          <image id="2" src=""/>
          <image id="3" src=""/>
          <image id="4" src=""/>
          <image id="5" src=""/>
        </binding>
      </visual>
     </tile>
    

    Please refer to TileTemplateType enumeration and Tile schema for more details.


    Best wishes,


    Robin [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, March 20, 2012 2:07 PM
    Moderator
  • Robin thanks for your reply.

    I actually want one wide image to be displayed at a time on the tile. I am using queuing. I want one wide image to replace the existing wide image in a loop after 10 seconds or so.

    Can you give me a simple example in JavaScript?I am working in JavaScript and have no knowledge of XML.

    Thanks

    Tuesday, March 20, 2012 6:19 PM
  • If I understand what you are trying to do, you want to use a notification queue.  This should help:

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465429.aspx

    This sample has a scenario for the notification queue, check it out and see if that is what you want:

    http://code.msdn.microsoft.com/windowsapps/App-tiles-and-badges-sample-5fc49148

    -Jeff


    Jeff Sanders (MSFT)

    Wednesday, March 21, 2012 7:37 PM
    Moderator