Join Michael Lehman for an in-depth discussion in this video Choosing a multipage controller, part of Windows Phone SDK Essential Training.
Well, now that we have all 154 sonnets that we can browse through and read, it might be a good idea to be able to keep track of which one of those are your favorite. In order to do that, we need to have a control that allows us to display multiple pages of information. The Windows phone operating system has two different ways of doing that. Those two ways are called the Panorama control and the Pivot control. What you are looking at here is the Panorama example application. You can see here is a list of items, we can swipe to the right, here is a second list of items, there is a background image that encompasses the entire thing, and if you watch as it scrolls here, you can see that the title up at the top scrolls at a different speed than the text and the background scrolls at a different speed than the list.
It's all designed to simulate effectively in magazine format. You can imagine one big wide magazine with a single background image and different articles or different chapters of an article underneath. Typically, what's done with a Panorama control and a good example of that is the pictures hub on an actual Windows phone device is that you are showing multiple lists of related but separate information. For example, the pictures you took on the phone and the pictures your friends posted on Facebook. Often times, the list of things in the Panorama, when you click on them, will dive down into another Pivot control which allows you to show two different views on top of the same data.
And of course, you can come back to the Panorama and go to a different section of the Panorama and so forth. One thing that I do want to show you is that if we look at the code for the panorama, and the solution, we will see that there is a panorama background image here, and if we look at that you will see this as an entire one wide, in this case 1024x768 pixel image that the operate system automatically scrolls underneath the pages in your panorama. And Microsoft has said that you should have no more than seven items in a panorama and then use that to drill down.
For our sonnets application, it makes a whole lot more sense than to use a pivot because we want to show two different views on top of the same list, you want to show all the sonnets, and we want to show the favorite sonnets. So let's take a look at that. And here is our sonnets plus application which has all of the sonnets as we had before, and it also has a page of favorites. Now we haven't created any favorites yet, so let's go look at a couple of sonnets and say, oh, I like that, we have added an application bar button down here, click it, and we get a little gold star up there as well as when we come back and look at the favorites list, its now in the list.
Let's favorite a couple of more so you can see not only that we can have multiple items in the list that show what happens if we decide that we have fallen out of love with this particular one and say, no not that one anymore, so we click the button again, the gold star goes away, when we come back to the list of favorites, it's not there anymore. So again, as we talked about, this is a pivot control, it has two separate list boxes in it, one list containing all of our sonnets and another list containing the ones that we think are our favorites.
And on both pages, you can of course go to the about page. All right, that's what we are going to build.
- Downloading and installing the tools
- Understanding the SDK
- Designing the user experience (UX)
- Implementing commands
- Data binding with Silverlight
- Exploring the Model-View-ViewModel (MVVM) pattern
- Loading external data
- Capturing data from the camera, GPS, compass, and accelerometer
- Recording and playing sound
- Implementing persistence with isolated storage
- Leveraging built-in tasks, choosers, and launchers
- Expanding the available controls using the Silverlight and Coding4Fun toolkits
- Cloning a Windows Phone app
- Learning how to publish your app
Skill Level Beginner
Q: This course was updated on June 10, 2013. What changed
- Over two dozen movies revised to reflect changes to Windows Phone 8 (released October 2012)
- New instructions for downloading and installing to Windows Phone toolset
- New instructions for working with Windows Phone 8 device data
- New chapter on native development with C++
- New chapter on advanced Windows Phone features including in-app purchasing with Wallet, reminders and notifications, Near Field Communication (NFC), and more.