Version

About Tile Templates

The xamTileManager™ exposes four item template properties, ItemTemplate, ItemTemplateMaximized, ItemTemplateMinimized and ItemTemplateMinimizedExpanded that correspond to the four tile states, normal, maximized, minimized and minimized-expanded, respectively. You do not have to write any code that switches templates based on a tile’s state. Instead, you can create a data template for each state and set the corresponding item template property and xamTileManager automatically uses the correct template based on a tile’s state.

In addition to the item template properties exposed by xamTileManager, each XamTile object also exposes four content template properties, ContentTemplateResolved, ContentTemplateMaximized, ContentTemplateMinimized and ContentTemplateMinimizedExpanded. The decision between setting the item template properties and the content template properties depends on whether you are binding xamTileManager to data or adding data items directly to xamTileManager’s Items collection. If you are binding xamTileManager to data, you can use the item template properties exposed by xamTileManager or the content template properties exposed by the Tile objects. However, if you are adding data items directly to xamTileManager’s Items collection, you must use the XamTile object’s content template properties.

The xamTileManager automatically displays the proper item template based on a tile’s state. You do not have to write any code to switch between templates. However, you should be aware of the impact if you do not define all four item templates.

  • If you do not define a minimized item template, a minimized tile will only display a header.

  • If you define a normal item template, but you do not define any other templates, the maximized and minimized-expanded tiles will use the normal tile’s item template while the minimized tile will only display a header.

  • If you define a maximized, minimized and/or minimized-expanded item template, but you do not define a normal item template, normal tiles will use the default data template for that data item; i.e., a data template that has its DataType property set to the data item’s type. If you do not define a default template for the data item, the normal tiles will display the string returned from the data item’s ToString method.

For an example of binding xamTileManager to data and using the various item templates, see Data Binding and Item Templates.