Windows 8 Using XAML: Introducing Badges
Excerpt by Ken Getz
As you have seen, tiles act as a Windows Store app's interface on the Windows Start screen. These tiles can display static or "live" data, depending on the functionality you add to the application. Sending notifications to the tiles to update their content is the topic of a different/earlier section-in this section, you'll learn about creating the badge that can appear in the lower-right corner of any tile. This badge is a separate entity from the tile content, and you create and update the badge separately.
Badge OverviewA badge on a tile displays summary or status information for the application, and that information must be specific to your particular application. In other words, it would be confusing and irrelevant to display information about anything other than the application associated with the tile. A badge on a tile can take on one of only two forms:
- A numeric value between 1 and 99; numbers greater than 99 appear as 99+.
- A glyph (a small image); one of a set of pre-defined glyphs.
- Network connection in an online game.
- User status in a messaging app.
- Number of unread email messages.
- Number of new posts in a social media app.
- Badges can only display numeric values between 1 and 99. Setting the value of the badge to 0 clears the badge, and setting the value to a number greater than 99 appears as 99+ on the badge.
- Badges can display a limited number of glyphs (plus a special glyph value, None, which displays nothing). You cannot extend the list, and Windows supplies all the glyphs that a badge can display.
NOTE Samples in this chapter assume that you have installed Visual Studio 2012 Update 1 (or later). If you are running the original release of Visual Studio 2012, some of the steps will not function correctly.This post is an excerpt from the online courseware for our Windows 8 Using XAML: Tiles, Badges, Print, and Charms,course written by expert Ken Getz.
This course excerpt was originally posted April 18, 2014 from the online courseware Windows 8 Using XAML, Part 14: Badges and Secondary Tiles by Ken Getz