In this article, we will discuss about Panorama controls in Windows Phone 7. The panorama controls enables you to create the UI of an application on the horizontal canvas which can be flicked to left and right with touch.
Let's see how we can use panorama control.
Step 1: Create a new project and select Windows Phone Panorama Application from Silverlight for Windows Phone.

Step 2: Add panoram control in the grid.
<Grid x:Name="LayoutRoot"> <controls:Panorama Title="Restaurant" Foreground="Maroon"> </controls:Panorama> </Grid>
Step 3: Let's add container in the panorama control. We are making restaurant menu using panorama control. We have added Appetizers, Breads and Desserts as container. The Grid inside each container tag can be used to place the control.
<!--Panorama item one-->
<controls:PanoramaItem Header="Appetizers" Foreground="{StaticResource PhoneAccentBrush}" > <Grid/> </controls:PanoramaItem>
<!--Panorama item two-->
<controls:PanoramaItem Header="Breads" Foreground="{StaticResource PhoneAccentBrush}"> <Grid/> </controls:PanoramaItem>
<!--Panorama item three-->
<controls:PanoramaItem Header="Desserts" Foreground="{StaticResource PhoneAccentBrush}"> <Grid/> </controls:PanoramaItem>
Step 4: Let's put a image in the background of panorama control. Panorama.Background control will be placed inside the panorama control.
<controls:Panorama.Background> <ImageBrush ImageSource="Recipe.jpg"></ImageBrush> </controls:Panorama.Background>
Step 5: Now let's run the application. And slide the container you will see Appetizers, Bread and Desserts container.
This ends the article of creating panorama control in Windows Phone 7.
|