Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you tell if your application tile is pinned to the start screen?

In a Universal app how can you tell if your application has been pinned to the start screen? I can see you can query the secondary tiles like this

SecondaryTile.FindAllAsync()

But I can't find anything similar for the primary tile.

(The reason I want to do this is to unregister for live tile updates if my app is no longer on the start screen)

like image 509
David Hayes Avatar asked Aug 05 '14 18:08

David Hayes


1 Answers

As for now it is impossible to detect if tile pinned to start page, but for your purpose you can use this:

NotificationSetting ns = TileUpdateManager.CreateTileUpdaterForApplication().Setting;

List of possible values for NotificationSetting variable ns can be found here.

I've checked this behavior. When tile was pinned - the value was Enabled, when I unpinned the tile - setting became DisabledForApplication. So you could assume that tile does not need updates if it is not in Enabled state.

Also you can review sample provided by Microsoft for more details.

Hope this will help.

like image 92
Anthony Avatar answered Sep 23 '22 03:09

Anthony