Friday, October 22, 2010

Windows Phone: Preventing the panorama control from scrolling

I have a panorama control that contains an InkPresenter control. Needless to say while drawing in the InkPresenter, the panorama manipulation events would still fire, scrolling the panorama.

I tried to google on how to temporarily lock the scrolling, and couldn’t find anything, hence this post.

The solution turned out to be quite simple: Subscribe to the ManipulationStarted event of the panorama control. You can then call the Complete() method on the event args to stop the manipulation.

So in my specific example, when the MouseLeftButtonDown event occured on the InkPresenter, I’d just set a local boolean “_panoScrollLocked” to true. This can then be queried on the Manipulation event of the panorama to prevent scrolling. Reset the variable again on the MouseLeftButtonUp event of the InkPresenter to restore the scrolling behaviour.

The same technique can be used for the Pivot control

Happy Coding :)

Wednesday, October 20, 2010

Windows Phone: Using Google Map images on the Bing Maps Control

I’m busy writing a Windows Phone application that involves a fair amount of map usage. When I first had a look on-line at the 2 main map providers (Bing and Google), I was quite disappointed to see that the quality of the Bing Maps were far inferior to those of the google offering – at least where I'm from here in South Africa. Needless to say this was a bit of a concern when I started developing.

Thankfully, after reading this post, I can now have the best of both worlds :). Yip – it outlines how to use Google Map images inside the Bing Maps control for silverlight.

As always, a picture is worth a thousand words, so here’s a screen grab from the windows phone emulator:


Above you see a view from my local golf course. On the left is the Bing image, and on the right the images provided from Google. We had upgrades done to the clubhouse more than 2 years ago, and the Bing maps are still showing the old building. You can also see that the Google images are far more detailed.

…. props to Microsoft for developing a map control that is so extensible, I can share it between my silverlight and windows phone projects, as well as plug in images from another provider!

Happy Coding :)

Monday, October 11, 2010

Daily Links 11/10/2010

Investigating Transactions Using Dynamic Management Objects
" When you hit performance problems in a database under load, and there is excessive locking and blocking, how can you determine exactly where the problems lie, in order to fix them?"

Silverlight Testing Automation Tool

31 Days of Windows Phone 7

Windows Phone 7 Design Templates

Windows Phone 7 - Top 10 Tips for a Successful Marketplace Certification

Profile your Windows Phone 7 Application for Free

Are you ready for the WP7 Marketplace? Here's an in-depth analysis of the Application Certification Requirements

Deploying your Windows Phone 7 Application to the actual hardware.

New Features and Improved Performance in Silverlight 4

"Mikogo is an easy-to-use [Free] cross-platform desktop sharing tool, ideal for web conferencing, online meetings or remote support."
Took it for a test-drive, and it's significantly better than Skype's screen sharing. Much better quality, esp. when presented with bandwidth constraints.
No VOIP, so use another tool (like Skype) in conjunction.