Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Lives Tiles are a Windows 10 feature that is not supported on later versions of Windows. For new apps, we recommend that you follow the current guidance for App icons.
Primary tile APIs let you check whether your app is currently pinned to Start, and request to pin your app's primary tile.
Important
Requires Creators Update: You must target SDK 15063 and be running Windows 10 build 15063 or later to use the primary tile APIs.
Important APIs: StartScreenManager class, ContainsAppListEntryAsync, RequestAddAppListEntryAsync
You put a lot of effort into designing a great experience for your app's primary tile, and now you have the opportunity to ask the user to pin it to Start. But before we dive into the code, here are some things to keep in mind as you're designing your experience:
If your app supports older versions of Windows 10, you need to check whether these primary tile APIs are available. You do this by using ApiInformation. If the primary tile APIs aren't available, avoid executing any calls to the APIs.
if (ApiInformation.IsTypePresent("Windows.UI.StartScreen.StartScreenManager"))
{
// Primary tile API's supported!
}
else
{
// Older version of Windows, no primary tile API's
}
Depending on the current Start menu, and your type of app, pinning your app to the current Start screen might not be supported. For example, IoT or xbox devices do not support pinning to Start. Therefore, before showing any pin UI or executing any pin code, you first need to check if your app is even supported for the current Start screen. If it's not supported, don't prompt the user to pin the tile.
// Get your own app list entry
// (which is always the first app list entry assuming you are not a multi-app package)
AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];
// Check if Start supports your app
bool isSupported = StartScreenManager.GetDefault().SupportsAppListEntry(entry);
To find out if your primary tile is currently pinned to Start, use the ContainsAppListEntryAsync method.
// Get your own app list entry
AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];
// Check if your app is currently pinned
bool isPinned = await StartScreenManager.GetDefault().ContainsAppListEntryAsync(entry);
If your primary tile currently isn't pinned, and your tile is supported by Start, you might want to show a tip to users that they can pin your primary tile.
Note
You must call this API from a UI thread while your app is in the foreground, and you should only call this API after the user has intentionally requested the primary tile be pinned (for example, after the user clicked yes to your tip about pinning the tile).
If the user clicks your button to pin the primary tile, you call the RequestAddAppListEntryAsync method to request that your tile be pinned to Start. This will display a dialog asking the user to confirm that they want your tile pinned to Start.
This will return a boolean representing whether your tile is now pinned to Start. If your tile was already pinned, this will immediately return true
without showing the dialog to the user. If the user clicks "No" on the dialog, or pinning your tile to Start isn't supported, this will return false
. Otherwise, the user clicked "Yes" and the tile was pinned, and the API will return true
.
// Get your own app list entry
AppListEntry entry = (await Package.Current.GetAppListEntriesAsync())[0];
// And pin it to Start
bool isPinned = await StartScreenManager.GetDefault().RequestAddAppListEntryAsync(entry);
Training
Learning path
Use advance techniques in canvas apps to perform custom updates and optimization - Training
Use advance techniques in canvas apps to perform custom updates and optimization
Documentation
Taskbar pinning sample - Code Samples
Demonstrates how to pin an app or secondary tile to the taskbar
Pin your app to the taskbar - Windows apps
You can programmatically pin your app to the taskbar, and you can check if it's currently pinned.
Pin secondary tiles to taskbar - UWP applications
Learn how to pin secondary tiles to the taskbar, giving your users quick access to content within your app.