locked
Secondary tile exists after unpin from start

    Question

  • I create a SecondaryTile within my app.  It appears on the start screen and if I call

    SecondaryTile.FindAllForPackageAsync() it appears in the returned collection.

    If I then unpin the tile manually it no longer appears on the start screen, but it is returned

    when calling FindAllForPackageAsync(). Is there a way to tell that the secondary tile has been

    unpinned outside the app?

    Saturday, November 1, 2014 6:10 PM

Answers

  • Thanks for the help.

    I found that the Exists() method returns false if the user removed the secondary tile from the Start screen even though SecondaryTile.FindAllForPackageAsync() returns the tile.

    • Marked as answer by DBaum Monday, November 3, 2014 6:27 PM
    Monday, November 3, 2014 6:27 PM

All replies

  • Hi DBaum,

    I use the code example from MSDN to test your scenario. https://code.msdn.microsoft.com/windowsapps/secondary-tiles-sample-edf2a178. But unfortunately, I cannot reproduce your problem. When I remove the tile manually on the start menu, I cannot retire any tile via SecondaryTile.FindAllForPackageAsync method.

    To work around your problem, I would recommend you use the SecondaryTile.Exists method to instead. Add the SecondaryTile.TileID into ApplicationData.Current.LocalSettings.values object after you create a new SecondaryTile object. When you want to check if the tile is exists next time, retire the TileID from LocalSettings, pass it into SecondaryTile.Exists method. Code would like the following.

    Add TileID into LocalSetting.

    SecondaryTile secondaryTile = new SecondaryTile("123456","Title text shown on the tile",tileActivationArguments,square150x150Logo,TileSize.Square150x150);
                    if (ApplicationData.Current.LocalSettings.Values.ContainsKey("SecondaryTileID"))
                    {
                        ApplicationData.Current.LocalSettings.Values.Remove("SecondaryTileID");
                    }
                    ApplicationData.Current.LocalSettings.Values.Add("SecondaryTileID", secondaryTile.TileId);
    

    Check if the Tile is exists.

    string tileid = ApplicationData.Current.LocalSettings.Values["SecondaryTileID"].ToString();
                if (true)
                {
                    bool flag = SecondaryTile.Exists(tileid);
                }
    

    If you still have questions, please post more information about your scenario.

    Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    • Marked as answer by DBaum Monday, November 3, 2014 6:24 PM
    • Unmarked as answer by DBaum Monday, November 3, 2014 6:25 PM
    Monday, November 3, 2014 8:15 AM
    Moderator
  • Thanks for the help.

    I found that the Exists() method returns false if the user removed the secondary tile from the Start screen even though SecondaryTile.FindAllForPackageAsync() returns the tile.

    • Marked as answer by DBaum Monday, November 3, 2014 6:27 PM
    Monday, November 3, 2014 6:27 PM