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.

Wednesday, August 25, 2010

Daily Links 25/08/2010

WP7: Windows Phone 7 Developer Tools Final - 16 Sep

Windows Phone and the Cloud--an Introduction

XNA WP7 getting started

Using self tracking entities with Silverlight 4 and Entity Framework 4

The ThreadPool is dead
Commentary on the parallel framework on codeplex.

Removing Event Handlers using Reflection

Introducing Microsoft Visual Studio LightSwitch
Rapid Application Developement framework for Visual Studio

An effective testing strategy
"If an application is critical to business, it’s going to require change. If it’s going to require change, we better be able to safely change it without affecting our client’s business."

Speeding up Visual Studio Build Times and Performance

Backing up and Restoring your TFS Server
PowerTool to make things just a tad easier :P

WikiPlex 1.4 Released
"WikiPlex is a regular expression based wiki engine that allows developers to integrate a wiki experience into an existing .NET application seamlessly and with little effort"

Wednesday, May 26, 2010

SilverlightContrib for Windows Phone

It seems that it's been a while since SilverlightContrib has been updated, and I needed the SharpZipLib port to do compressed serialization in some of my Windows Phone projects, so I downloaded the source, upgraded the lib with VS2010, removed the System.Windows.Browser dependency (which silverlight for Windows Phone doesn't have), and recompiled.
The only things I had to remove from the lib was the MouseWheelHelper, and ClipboardHelper, so it wasn't a train smash.

Here's the lib for those who might need it (have yet to see if it actually works, but I don't see why not).
I've renamed the assembly, so it won't get confused with other versions.

Tuesday, May 25, 2010

Visual Studio Editor - Ctrl+Arrow navigation not working

Thought I might post the solution here, since this was infuriating me for a number of days, and I couldn't find anything related on the web.

Visual Studio Menu:
Tools | Options
On the left menu:
Environment | Keyboard
Click the reset button on the top right.

... so simple I should have thought of it sooner :|