multiple tiles?

5 posts, 1 answers
  1. brandon
    brandon avatar
    12 posts
    Member since:
    May 2014

    Posted 20 May 2014 Link to this post

    i'm using live tile helper to pin "custom" tiles to the start screen, right now i'm allowing users to choose the color of the tile, add text or make a transparent tile.  but right not if i go back in to the app and make a change to my tile it pins over the top of the existing tile. is it possible to create a new tile everytime? that way the user could make different colored tile or multiple transparent tiles?

    thanks
  2. Todor
    Admin
    Todor avatar
    778 posts

    Posted 21 May 2014 Link to this post

    Hello Brandon,

    The secondary tiles are distinguished by their Uri, so if you want to create a new tile that points to the same page but has a different Uri, you can use something like this:
    Uri uri = new Uri("/MainPage.xaml?id=1", UriKind.RelativeOrAbsolute);

    Instead of the static number "1" in the example you can use the value of a variable which counts how many tiles you have already pinned.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. DevCraft banner
  4. brandon
    brandon avatar
    12 posts
    Member since:
    May 2014

    Posted 21 May 2014 in reply to Todor Link to this post

    getting close i think!

    i created this when i pin a tile

      private void btnPin_Click(object sender, RoutedEventArgs e)
            {
               
       
                if(appSettings.Contains("tileCount"))
                {
                    int count = (int)appSettings["tileCount"];
                    tileCount = count + 1;
                    appSettings["tileCount"] = tileCount;
                    appSettings.Save();


    which increase tileCount by 1 each time  a new tile is pinned and then i added this

    Uri uri = new Uri("/MainPage.xaml?id=tileCount", UriKind.RelativeOrAbsolute);


    but it is still overwriting my tile i also tried ?id=tileCount() but got the same results. am i doing something wrong?

    thanks


  5. Answer
    Todor
    Admin
    Todor avatar
    778 posts

    Posted 22 May 2014 Link to this post

    Hello Brandon,

    It seems that you provide the string "tileCount" as id instead of the value of the variable with that name. Try with:

    Uri uri = new Uri(String.Format("/MainPage.xaml?id={0}", tileCount), UriKind.RelativeOrAbsolute);

    I hope this information helps.

    Regards,
    Todor
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  6. brandon
    brandon avatar
    12 posts
    Member since:
    May 2014

    Posted 22 May 2014 in reply to Todor Link to this post

    works great! thanks
Back to Top
DevCraft banner