This sample shows how to pin and use a secondary tile, which is a tile that directly accesses a specific, non-default section or experience within an app, such as a saved game or a specific friend in a social networking app. Sections or experiences within an app that can be pinned to the Start screen as a secondary tile are chosen and exposed by the app, but the creation of the secondary tile is strictly up to the user.
Note This sample was created using one of the universal app templates available in Visual Studio. It shows how its solution is structured so it can run on both Windows 8.1 and Windows Phone 8.1. For more info about how to build apps that target Windows and Windows Phone with Visual Studio, see Build apps that target Windows and Windows Phone 8.1 by using Visual Studio.
The sample demonstrates the following scenarios:
- Pinning a secondary tile to the Start screen
- Removing a secondary tile from the Start screen
- Enumerating all secondary tiles owned by the calling app
- Determining whether a particular tile is currently pinned to the Start screen
- Processing arguments when the app is activated through a secondary tile
- Sending a local tile notification and badge notification to the secondary tile
- Using the app bar to pin and unpin tiles. (JavaScript and C# only)
- Updating the secondary tile's default logo
- Selecting from among alternative secondary tile visuals (Windows only)
- Selecting from among alternative secondary tile visuals as an asynchronous operation (Windows only)
Note Some functionality in the sample requires that the tile can receive notifications. Tile notifications can be disabled by a user for a single app or for all apps, or by a system administrator by using group policy.
To obtain an evaluation copy of Windows 8.1, go to Windows 8.1.
To obtain an evaluation copy of Microsoft Visual Studio 2013, go to Visual Studio 2013.
Note For Windows 8 app samples, download the Windows 8 app samples pack. The samples in the Windows 8 app samples pack will build and run only on Microsoft Visual Studio 2012.
Related topics
- Guidelines and checklist for secondary tiles
- Quickstart: Pinning a secondary tile
- Quickstart: Sending notifications to a secondary tile
- SecondaryTile class
- Secondary tiles overviews
Operating system requirements
| Client | |
|---|---|
| Server | |
| Phone |
Run the sample
The next steps depend on whether you just want to deploy the sample or you want to both deploy and run it.
Deploying the sample
-
To deploy the built Windows version of the sample:
- Select SecondaryTiles.Windows in Solution Explorer.
- Use Build > Deploy Solution or Build > Deploy SecondaryTiles.Windows.
-
To deploy the built Windows Phone version of the sample:
- Select SecondaryTiles.WindowsPhone in Solution Explorer.
- Use Build > Deploy Solution or Build > Deploy SecondaryTiles.WindowsPhone.
Deploying and running the sample
-
To deploy and run the Windows version of the sample:
- Right-click SecondaryTiles.Windows in Solution Explorer and select Set as StartUp Project.
- To debug the sample and then run it, press F5 or use Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.
-
To deploy and run the Windows Phone version of the sample:
- Right-click SecondaryTiles.WindowsPhone in Solution Explorer and select Set as StartUp Project.
- To debug the sample and then run it, press F5 or use Debug > Start Debugging. To run the sample without debugging, press Ctrl+F5 or use Debug > Start Without Debugging.
- Give it several seconds to launch in the emulator (it takes over the full screen, so if you're still seeing your Start screen tiles, the sample hasn't launched yet), after which you can find the sample in the Apps list. Add the tile's sample to the Start screen so that you can see the result of the action that you've taken in the sample. A tile must be pinned to the Start screen to receive notifications.
How to use the sample
In some of the scenarios, you need to switch to the Start screen to see the effect of the scenario on the secondary tile. Click the sample tile to return to the main sample page or the secondary tile (in this sample, the secondary tile simply says "Windows SDK") to be taken into an area of the sample that confirms that you've launched it from a secondary tile.
Note that the response to pinning a tile differs between Windows and Windows Phone. On Windows Phone, when you pin a secondary tile, you exit the app and are taken to the Start screen. In Windows, you must manually switch to the Start screen to see the secondary tile.