Building Blocks for Designer Friendly Windows Phone Code

15. June 2011

Last night at PDXSLUG I was able to talk about some easy to use building blocks for design-time data friendly Windows Phone projects.  The main benefit of the approach is that you do not have to press F5 all the time.  Instead there is visible sample data in the design surfaces of Visual Studio 2010 and Expression Blend 4.  This isn’t “Lorem Ipsum” generated xml sample data.  The actual code you write for design time data is exercised at design time.  It is a visual test of that code as well. 

The time saving act of making changes without waiting for the emulator or browser to startup translates directly into making a better application.  You can use this technique for one or a collection of model objects, results from a design time web service, and even images.  The example is small but using some simple building blocks like MVVM Light and MicroIoC it can scale nicely.  It works for Silverlight as well as WP7 projects with little change.  By going through the steps of making the designers display sample data, I know that I’m making my applications more maintainable, and I’m not going to waste time waiting to see if layout changes work at run time. 

Here is the point: Count the developers you have on a UI project and multiply that by a minimum of 1 minute every time someone needs to press F5.  That is time that could be used for actually adding new features, making existing features better, or fixing important bugs.

Read more about all of this in my blog series on the same subject.  Here is a quick set of links:

Blog Series Part 1

MVVM Light 

MicroIoC 

Bindable App Bar 

Container singleton pattern 

App Hub 

The completed source code from the talk is available in Part 6 of the blog series.