Missing Background Image on Panorama Control breaks ContextMenu and Causes Performance Issues in Windows Phone apps
2/2/2012source: nicksnettravels
Warning: If you are using a background image for a Panorama control in your application, make sure you get the path correct. Here's why:
Today I was working on a relatively complex application that uses the Panorama control on the main page of the application. It also has a context menu on items in a couple of the panes with the panorama control. Up until this afternoon everything seemed to work fine. However, as we get close to finishing the project I decided to go through and clean up the images that were included in the project (if you've ever worked with a designer or spent a lot of time in Blend you'll understand why I have to do this step!). Now in most cases your application will continue to work even if the path to your images are wrong - you just won't see an image where you expect to. This can make it a little hard to ensure you haven't broken anything as part of the clean up process.
After doing the clean up I did notice that I'd broken a couple of image paths but figured that I'd fixed most of them. I did however also notice that the application was performing really slowly, like it would take a second or so to add a character into a textbox. As I mentioned this is a relatively complex application so I thought that I must have broken some logic in the background causing a perf issue. What I didn't realise was that the perf issue was related to my image clean up.
Figuring I'd come back to sort out the perf issue later (I've been focussed on getting one part of the app finished today so head was in a different place in the app dev cycle) it wasn't until I noticed another bug that I had to stop what I was doing and address the issue (although at the time I figured it was unrelated). It turned out that none of the the context menus (from the Silverlight toolkit) were working. OMG I thought, what have I done now.. I even thought I'd ping Jeff and see whether he had any gems of wisdom.
...Read more
You can also follow us on Twitter @winphonegeek
Comments
New! WindowsPhoneGeek Component Marketplace
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
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
