How to add Panorama to existing WP7 project
published on: 1/16/2012 | Views: N/A | Tags: Beginners Panorama
by Tianyu Zhang
While developing my latest WP7 app I came across the question how to add a Panorama to my existing WP7 project. I did not want to use the default Visual Studio templates because they generate too much code(for a simple app like mine) with all the data binding and view models.
In short I had a database and wanted to show some data in a Panorama control without using MVVM or any default VisualStudio template. So here is what I did:
Step1. Lets say that we have an existing Windows Phone application project.
Step2. Add a reference to "Microsoft.Phone.Controls" available under the .NET tab in the "Add Reference" window:
Step3. Include the following namespace into your page:
xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
Step4. That's it now you can add Panorama and PanoramaItem via the "control" namespace that you have defined in Step3 :
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0">
<controls:Panorama Title="Panorama">
<controls:PanoramaItem>First Item</controls:PanoramaItem>
<controls:PanoramaItem>Second Item</controls:PanoramaItem>
</controls:Panorama>
</Grid>
Grab the source here:
You can also follow us on Twitter @winphonegeek
Comments
Our Top Articles & Free books
- Our FREE e-book: "Windows Phone Toolkit In Depth" 2nd edition
- 400+ Windows Phone Development articles in our Article Index
- 21 WP7 Toolkit in Depth articles covering all controls
- 12 WP7 Coding4Fun Toolkit in Depth articles covering all controls
- Performance Tips when creating WP7 apps
- Creating a WP7 Custom Control in 7 Steps
- WP7 working with VisualStates: How to make a ToggleSwitch from CheckBox
- What makes a WP7 App successful
- Creating theme friendly UI in WP7 using OpacityMask
- Implementing Windows Phone 7 DataTemplateSelector and CustomDataTemplateSelector
- All about Splash Screens in WP7 – Creating animated Splash Screen
- Getting Started with Unit Testing in Silverlight for WP7
- WP7 WatermarkedTextBox custom control
Our Top Tips & Samples
- All about WP7 Isolated Storage series
- WP7 Dynamically Generating DataTemplate in code
- 5 tips for a successful WP7 Marketplace submission
- WP7: Navigating to a page in different assembly
- WP7 ContextMenu: answers to popular questions
- WP7 ListBox: answers to popular questions
- WP7 working with Images: Content vs Resource build action
- WP7 Element Binding samples
- WP7 working with XML: reading, filtering and databinding
- Drawing in WP7: #2 Drawing shapes with finger
- WP7 TextBox Light theme problems - the solution
- Changing the WP7 Panorama Background Image dynamically with Animation
