,

Getting Started with Live Tiles

When discussing live tiles (also known as shell tiles) it is important to recognize the distinction between primary and secondary tiles. An app can have at most one primary tile, which can be pinned to the Start Experience by the user. In addition, an app can place multiple secondary tiles on the Start Experience, which can deep-link back to a specific area within the app. A primary tile is defined statically in the app’s WMAppManifest.xml file, whereas secondary tiles are created dynamically within code.


Note

It is at the user’s discretion to pin an app to the Start Experience. You should not, therefore, rely on the presence of a particular tile on the Start Experience.


Windows Phone 8 supports three tile templates: flip, iconic, and cycle. The tile template determines the layout and composition of the tile and the behavior of the tile when it is pinned to the Start Experience.

To configure the template used by your app, open the WMAppManifest.xml file in Visual Studio. The Application UI tab includes a Tile Template drop-down list that allows you to select the template used by your app’s primary tile (see Figure 13.1).

Image

FIGURE 13.1 The WMAppManifest.xml file allows you to configure the primary tile.

The Tile Template drop-down list box contains the following three items, corresponding to the flip, cycle, and iconic tile templates, respectively:

Image TemplateFlip

Image TemplateCycle

Image TemplateIconic

You explore each of the three templates, and see their differences, later in the chapter.

The size of a shell tile is customizable by the phone user. By tapping and holding a tile, the user is able to resize a tile to be either small or medium sized, and if enabled in your app, to a wide size that spans across an entire row on the Start Experience.


Note

If you intend to support large tiles, be sure to check the Support for Large Tiles check box, which is not checked by default. If left in its default state, the user is prevented from resizing the tile to the large size.


Tile images must be in either JPG or PNG format. When you select a tile image from within the WMAppManifest UI, if the file does not already exist in your project, it is copied to your project’s root directory. If the file is already included in your project prior to selecting it, it is referenced at its current location.


Note

You cannot change the template used by your primary (default) tile programmatically. It is therefore important to carefully choose the template that your app uses before publishing it to the Windows Phone Marketplace. Once published, the only way to change the template is to issue an update for your app.

This restriction, however, does not apply to secondary tiles, which can be added programmatically and which, like the primary tile, may use any of the three templates. Secondary tiles are discussed in greater detail in Chapter 32, “Conducting Background Activities with Scheduled Actions.”



Note

Tiles use sound and animation; however, these are determined by the OS and are not extensible.


A tile can be updated from within your app while the app is in the foreground, from a background agent, from a scheduled notification, or by using a cloud service and push notifications.

A tile is updated using one of three classes depending on the tile template: FlipTileData, CycleTileData, or IconicTileData. We explore how to update a tile programmatically later in the chapter.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.254.133