Cosmin
Cosmin

Reputation: 33

(UWP) Can the primary tile be unpinned from the Start Screen?

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

Answers (2)

Angel T
Angel T

Reputation: 182

Yes, it can.

PIN => bool x = await tile.RequestCreateAsync();

UNPIN => bool x = await tile.Request​Delete​Async();

Upvotes: 1

Martin Zikmund
Martin Zikmund

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

Related Questions