Displaying Page Numbers

When swiping through items displayed by a FlipView, it can be useful to know which item you are viewing out of how many items. In other words, you might want to display a page number (see Figure 7.8).

Image

FIGURE 7.8 Displaying a page number with a FlipView

You can use the FlipView control’s currentPage property to retrieve the current page (the index of the current item) displayed by the FlipView. You can use the count() method to get the total number of pages (the total number of items) contained in the data source associated with the FlipView.

The page in Listing 7.16 contains a FlipView and a DIV element. The DIV element ...

Get Windows® 8.1 Apps with HTML5 and JavaScript Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.