Things worth knowing

As said in the previous post, the overall development experience on Windows Phone is quite good, but there are some things that didn’t work as I expected. When I started to develop what eventually became EasyNote I ran into couple of surprises that caused some head-scratching and furious googling. To save myself from having to search again for the same solutions in the future I’m listing them here, starting with the following 4 items.

As far as I know everything below is valid also in Mango.

Silverlight for Windows Phone Toolkit

The set of Silverlight controls included in Windows Phone SDK is missing some often used controls like date and time pickers, context menus, toggle switches and so on. Luckily Microsoft provides a free set controls in the form of Silverlight for Windows Phone Toolkit (WP Toolkit from now on)

Windowsphonegeek has nice set of articles describing how to use the controls: http://www.windowsphonegeek.com/articles/21-WP7-Toolkit-in-Depth-articles-covering-all-controls

Page transition animations

Ok, so you create a new application using the data bound application template. Once the project is created you run it in the emulator and click on an item on the list. Another page appears but there’s no animation, WTF? In my opinion having consistent transition animations is one of the most important things in making your application feel like part of the platform instead of a “second class citizen”.

WP Toolkit makes it relatively easy to enable the animations. To animate Page transitions, install WP Toolkit and follow the instructions on Windowsphonegeek: http://www.windowsphonegeek.com/articles/Windows-Phone-7-Navigation-Transitions-Step-By-Step-guide


Orientation change animations

Making the application support landscape orientation is very easy, just set SupportedOrientations="PortraitOrLandscape" in the XAML of each PhoneApplicationPage that you want to automatically switch between portrait and landscape. Unfortunately the change is not animated by default.

David Anson from Microsoft has created a couple of different orientation change animations, which are available in this blog post:
http://blogs.msdn.com/b/delay/archive/2010/09/28/this-one-s-for-you-gregor-mendel-code-to-animate-and-fade-windows-phone-orientation-changes-now-supports-a-new-mode-hybrid.aspx.

The solution above has one big problem, it conflicts with the page transition animations implemented by WP Toolkit. However, it is quite easy to modify the animations to work with WP toolkit as well, as described in this post: http://mobileworld.appamundi.com/blogs/andywigley/archive/2010/11/24/best-of-breed-page-rotation-animations.aspx.


Toolbar icons

EasyNote has a Toolbar on each Page, so the next problem was getting icons for the Toolbar buttons. I’m no artist so this was turning into an actual issue. Well, it turned out that the SDK already contains a set of most often used icons that can be used in the applications. The icons can be found from here:
C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Icons

If you use the icons from “dark” folder, Toolbar will even automatically colorize the icons in case the user switches to light style (making all UI elements white instead of the default black).

Leave a comment