ApplicationBar – not your usual control
If you are coding Silverlight apps for Windows Phone 7 you have probably used the ApplicationBar for your menu needs. If it’s confusing you with the way it works, or even giving you NullPtr exceptions when you try to access it’s properties, it’s because it’s no Silverlight control.
Looking at the XAML for the template “Windows Phone Application” in Visual Studio, there is an ApplicationBar defined. If you have used that template and tried databinding the ApplicationBar then you will have noticed that it’s not working, or even producing exceptions.
If you need to control the ApplicationBar in any way and change things dynamically, you need to do this from the c# codebehind. Even if you name the bar (or it’s components) with x:Name in XAML, you won’t be able to reach those objects from the codebehind.
What you need to do is to work directly with the instanced ApplicationBar from the codebehind. Say for example you need to change the icon for button number 3 on the fly, this is the way to do it: ((ApplicationBarIconButton)(ApplicationBar.Buttons[2])).IconUri = new Uri("NewIcon.png", UriKind.Relative);
This is also very important to remember if you are going to localize your app, as you can’t databind the translations as you can with all other Silverlight controls!
Thursday, November 18, 2010 | 0 Comments
WP7 - WPDT CTP Refresh

The Windows Phone Developer Tools CTP refresh is finally out. This version is now compatible with the release version of Visual Studio 2010.
To download WPDT go here.
For info about what's new, check out the Windows Phone Developer Blog.
Saturday, May 01, 2010 | 0 Comments
Mix 10
Mix 10 has been held and a lot of new info about Windows Phone 7 has been released.
For developers we now know that Silverlight or XNA is the choice for developing code. There is a new emulator released, a new XNA CTP (v4.0) and a Visual Studio 2010 Express for Windows Phone CTP released, all available for download here.
A short list of things further revealed was:
- Copy and paste will not be implemented from release
- There won't be support for real multitasking, although functionality for notifiers being shown while users are using other apps will be supported
- The only way to get apps for the devices will be through the Windows Phone Marketplace
- For developers releasing apps via the marketplace Microsoft will take 30% of the profit
- Developers can define "Trial parameters" for apps, letting consumers test the app for free until a predefined time has lapsed, or until a point of "progress" has been reached
The list of hardware requirements is as follows:
- Capacitive multi-touch with support for four contact points
- Screen size of 800*480 (to start out with, later on smaller 480*320 devices will appear)
- A Qualcomm Snapdragon CPU
- 256MB or more RAM, 8GB or more flash storage
- Accelerometer
- Wifi
- GPS
- Minimum 5 mega-pixel camera
- Five specific buttons: Power, Camera, Start, Back and Search (these are mandatory, but some devices will have more, the first LG device even sporting a keyboard)
Saturday, April 03, 2010 | 0 Comments