locked
TileSquare310x310ImageCollectionAndText02 Won't Display Images RRS feed

  • Question

  • I am pulling my hair out. Is there a way to see why tile notifications are rejected? I have wasted hours trying to figure out why this tile template won't display the notifications. Using the same images the TileSquare310x310ImageAndText02 template works fine. I also tried the TileWide310x150PeekImageCollection06 used the same 150x150 images for the small images and it worked fine.

    Here is the code I am using. If you could tell me how to find out why the notifications are being rejected or point out where I am making a mistake in the code it would be greatly appreciated!

    This method generates the notifications for the Secondary Tile...

    public

    voidSendNotificationsSecondaryTile()

            {

               

    intmaxNotifications = MAX_NOTIFICATIONS;

               

    //create upto 5 notifications


               

    TileUpdatertileUpdater = TileUpdateManager.CreateTileUpdaterForSecondaryTile(TrackedEvent.TileId);

               

    if(ImageCount > 0)

                {

                    tileUpdater.EnableNotificationQueue(

    true);

                   

    //create 5 notifications for each tile size


                   

    if(ImageCount < 5) { maxNotifications = ImageCount; }

                   

    //create the notifications


                   

    for(inti = 0; i < maxNotifications; i++)

                    {

                       

    ITileSquare310x310ImageCollectionAndText02largeTile = CreateLargeTileImageCollectionContent(i);

                       

    //ITileSquare310x310ImageAndText02 largeTile = CreateLargeTileContent(i);


                       

    ITileWide310x150ImageAndText01wideTile = CreateWideTileContent(i);

                       

    //ITileWide310x150PeekImageCollection06 wideTile = CreateWidePeekImageCollection(i);


                        largeTile.Wide310x150Content = wideTile;

                        wideTile.Square150x150Content = CreateSquareTileContent(i);

                        tileUpdater.Update(largeTile.CreateNotification());

                    }

                }

               

    else


                {

                   

    //no pictures use icon images


                   

    //TO DO: Add Icon Image Tile Content


                }

            }

    This Method creates the content for the 310x310 template.

    private

    ITileSquare310x310ImageCollectionAndText02CreateLargeTileImageCollectionContent(intfileIndex)

            {

               

    ITileSquare310x310ImageCollectionAndText02tileContent = TileContentFactory.CreateTileSquare310x310ImageCollectionAndText02();

                tileContent.Branding =

    TileBranding.Logo;

                tileContent.ImageMain.Src = GetLargeFilenamePath(fileIndex);

    //picture is 310x310 and less than 200k


                tileContent.ImageSmall1.Src = GetSquareFilenamePath(1);

    //picture is 150x150 and less than 200k


                tileContent.ImageSmall2.Src = GetSquareFilenamePath(2);

    //picture is 150x150 and less than 200k


                tileContent.ImageSmall3.Src = GetSquareFilenamePath(3);

    //picture is 150x150 and less than 200k


                tileContent.ImageSmall4.Src = GetSquareFilenamePath(4);

    //picture is 150x150 and less than 200k


    #if

    DEBUG

               

    //TO DO: ADD RESOURCE MANAGER FOR STRINGS


                tileContent.TextCaption1.Text =

    string.Format("{0} days until {1}", TrackedEvent.DaysRemaining, DateTime.Now.ToString("g"));

                tileContent.TextCaption2.Text = TrackedEvent.Name;


    #else


                tileContent.TextCaption1.Text = string.Format("{0} {1}", TrackedEvent.DaysRemaining,

                    _resourceManager.GetString(Common.Constants.SR_TILE_DAYS_UNTIL_KEY));

                tileContent.TextCaption2.Text = TrackedEvent.Name;


    #endif


               

    returntileContent;

            }

    Thanks is advance for your help!

    Monday, November 25, 2013 12:51 AM

Answers

  • I finally figured this one out. In my application manifest I forgot to put Assets\<imagename>.png for the 310x310 tile. This caused the 310x310 secondary tiles and application main tile to only show one notification for some reason. Once I fixed the manifest everything started to work. I spent days going crazy on this. Would be nice if there was some error message from the tile. Or perhaps visual studio could give the error message icon if it does not find the image path in the manifest.
    Tuesday, December 3, 2013 4:21 AM

All replies

  • Can you explain more about them being "rejected"? What does that mean?

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Monday, November 25, 2013 2:11 PM
    Moderator
  • Hi Matt Yes, by rejected I mean that the notifications are ignored and do not display when the tile size is 310x310, but they work For the other sizes. I was originally using png files until I discovered that they were just over the 200k limit. It would be nice if there was some explanation when a notification is ignored. I am now using jpg files that are way smaller than 200k but the 310x310 tile notification is ignored. It's just that template. For example if I use the commented out template for the 310x310 it works fine. Same images. Any ideas?
    Tuesday, November 26, 2013 4:28 AM
  • I finally figured this one out. In my application manifest I forgot to put Assets\<imagename>.png for the 310x310 tile. This caused the 310x310 secondary tiles and application main tile to only show one notification for some reason. Once I fixed the manifest everything started to work. I spent days going crazy on this. Would be nice if there was some error message from the tile. Or perhaps visual studio could give the error message icon if it does not find the image path in the manifest.
    Tuesday, December 3, 2013 4:21 AM