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)
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With