locked
Custom Tiles RRS feed

  • Question

  • Hi, Is there a way to create custom tiles?

    I want the application to create new tiles that display the information the user enters in textboxes.

    Also is there a way to programmatically resize tiles (square and rectangle)

    Monday, November 5, 2012 12:05 AM

Answers

  • Thanks Andrei for your help.

    Hi singh029,

    To display the information user entered in the TextBox control, please try the following code:

    XmlDocument tileXML = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquareBlock);
                XmlNodeList tileTextAttribute = tileXML.GetElementsByTagName("text");
                //tileContent is the name of a TextBox control
                string tileContentStr = tileContent.Text.ToString();
                tileTextAttribute[0].InnerText = tileContentStr;
                TileNotification tileNotification = new TileNotification(tileXML);
                tileNotification.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(10);
                TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);

    Also, take a look at this article for further information about how to work with Tile: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868253.aspx 

    And for your second question, just as Andrei mentioned above, user can resize your tile between the square and wide on the Start screen by right-clicking the tile and select the Smaller or Larger button. You can't resize it programmatically as there is no way for you to know which state the tile is in when you send a notification.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 5, 2012 3:45 AM
    Moderator

All replies

  • 1) You can use one of the predefined tile templates and populate it with your data

    2) No, only user can do it

    Monday, November 5, 2012 1:05 AM
  • Thanks Andrei for your help.

    Hi singh029,

    To display the information user entered in the TextBox control, please try the following code:

    XmlDocument tileXML = TileUpdateManager.GetTemplateContent(TileTemplateType.TileSquareBlock);
                XmlNodeList tileTextAttribute = tileXML.GetElementsByTagName("text");
                //tileContent is the name of a TextBox control
                string tileContentStr = tileContent.Text.ToString();
                tileTextAttribute[0].InnerText = tileContentStr;
                TileNotification tileNotification = new TileNotification(tileXML);
                tileNotification.ExpirationTime = DateTimeOffset.UtcNow.AddSeconds(10);
                TileUpdateManager.CreateTileUpdaterForApplication().Update(tileNotification);

    Also, take a look at this article for further information about how to work with Tile: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh868253.aspx 

    And for your second question, just as Andrei mentioned above, user can resize your tile between the square and wide on the Start screen by right-clicking the tile and select the Smaller or Larger button. You can't resize it programmatically as there is no way for you to know which state the tile is in when you send a notification.

    Thanks.


    Vicky Song [MSFT]
    MSDN Community Support | Feedback to us

    Monday, November 5, 2012 3:45 AM
    Moderator