Reputation: 33
I want my UWP app to provide the user with the opportunity to Pin/Unpin the app to the Start Screen by pressing a button.
I have managed to pin the app using this code:
AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];
bool isPinned = await StartScreenManager.GetDefault().RequestAddAppListEntryAsync(entry);
However, I could not find anywhere a way to unpin the app. Is the unpin functionality available for secondary tiles only?
Upvotes: 0
Views: 345
Reputation: 182
Yes, it can.
PIN => bool x = await tile.RequestCreateAsync();
UNPIN => bool x = await tile.RequestDeleteAsync();
Upvotes: 1
Reputation: 39072
No, it does not seem so. The StartScreenManager
is the class that manages the primary app tiles and currently it only allows the user to pin the primary tile, not unpin it, in contrast to SecondaryTile
which can be unpinned.
You can instruct the user how to unpin the tile manually only.
Upvotes: 2