1
2
3
4
5
6

How to Customize Your XNA Game Tile on the Windows Phone 7 Start Page

Currently if you build an XNA game and run it on the WP7 emulator you'll note that once you exit the program, it isn't listed in the main application list like it would be for a Silverlight application. This can make it tough to validate how your icon looks, and makes it impossible to pin it to the emulator's tile-view start screen.

A Cheat Sheet for Unit Testing Silverlight Apps on Windows Phone 7

I've been planning on writing a quick overview of the basics of unit testing in Silverlight for a while now. Since Windows Phone 7 is the hot topic now, and there are a few quirks with using the Silverlight Unit Test Framework with it, I figured now would be a good chance to write a blog entry covering both. If you're just looking for the cheat sheet relative to both Silverlight and WP7 unit tests, then skip the first section on setting up the test harness on WP7.

Setting up the Test Harness for WP7
To get started, you'll need the Silverlight Unit Test Framework tweaked for Windows Phone 7 from Jeff Wilcox's blog here. I've attached the binaries to this post as well (SL3_UTF_May.zip).

Once you have the binaries, you'll want to create a new test harness project. Do this by creating a new project in your solution of type 'Windows Phone Application'. In the sample attached to this post I'm calling my test project SampleTestProject.

Next, add references to the two Silverlight Unit Test Framework DLLs*:
Microsoft.Silverlight.Testing.dll
Microsoft.VisualStudio.QualityTools.UnitTesting.Silverlight.dll

* you will get a warning about referencing Silverlight 3 assemblies, click 'yes' when asked if you want to continue

Because of recent changes in WP7, you can no longer set the root visual in the App.xaml.cs like normal. Instead, you'll setup the test page in the Loaded() event of your MainPage.xaml.cs in your test project. The following code hides the SystemTray on the phone (the bar at the top of the screen) which otherwise would cover up the top of test results screen, and hooks up the back button to allow you to return back from drilling into test results.

using Microsoft.Phone.Shell;
using Microsoft.Silverlight.Testing;
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
    SystemTray.IsVisible = false;

    var testPage = UnitTestSystem.CreateTestPage() as IMobileTestPage;
    BackKeyPress += (x, xe) => xe.Cancel = testPage.NavigateBack();
    (Application.Current.RootVisual as PhoneApplicationFrame).Content = testPage;            
}

(click 'read more' to keep reading..)

Quick Tip: Windows Phone 7 Preprocessor Directive

If you're sharing common code between Windows Phone 7 and other platforms in either Silverlight or XNA, then you may run into a need to fork some code based on the platform. This is normally done with a preprocessor directive, which for Windows Phone 7 is WINDOWS_PHONE.

UI Design and Interaction Guide for Windows Phone v2.0 Released

An updated version of the UI Design and Interaction Guide for Windows Phone was posted on the Windows Phone 7 forums today. There is also a big collection of Photoshop files to help when designing your apps which can be downloaded here as well.


click the image to download

Take a look through the new guide and feel free to post anything you find interesting either here or at the official forums. The guide has gone from 69 pages to 101 pages, so there should be lots of expanded content to look through.

Below are some sample shots from the updated guide. You can find the 10 items that can be shown in the Status Bar, the push notifications whose colors conform to the user's accent color, and the updated application bar which now shows button labels - hopefully you've already noticed most of this playing around with the most recent release of the developer tools.

You can also check out all the available accent colors in the updated guide. My guess is that these are the final theme choices, but I wouldn't be surprised if different phone carriers add in their own company colors and perhaps set them as the default.

Updated Video of Hungry Castaway - An XNA Game for Windows Phone 7

Two weeks ago in my post Pre-Alpha Videos of My Windows Phone 7 Games in Development I posted a short video of a game called 'Hungry Castaway' that I am working on with one of my friends for Windows Phone 7. At that point I had only gotten as far as replicating a concept I had done in Silverlight over to XNA. Now that I've had two weeks to get some work done I wanted to post an updated video.

click here to watch at a larger size

At 0:44 into the clip the video skips ahead to show more hectic gameplay to give an example of how the gameplay scales based on skill. Please keep in mind this game is still early on, so the gameplay in this video likely doesn't reflect the final game.

Pre-Alpha Videos of My Windows Phone 7 Games in Development


It has been mentioned a few times in the last month or so that if you want a Windows Phone 7 test device, then you need to be showing why you deserve one. Most notably, Brandon Watson has laid out a post showing 2 such examples, and listing 6 suggestions of how to garner the @wp7dev team's notice. Well, I'm going to take those 6 suggestions, and respond to each - because I want a friggin' test device.

1) Get the tools and start building apps.
I am working on 3 games independently, as well as several at IQ.
2) Blog about your development progress. Screenshots and videos help a lot.
See #3
3) Tag posts with "Windows Phone 7 Development" or "wp7dev" so that we, and other developers, can find you.
Windows Phone 7 Posts on SmartyPantsCoding.com
4) Build something which extends the platform and can be used by other developers.
How to use the Facebook Developer Toolkit with Windows Phone 7
My Windows Phone 7 Pivot Control

5) Post videos of your apps running in the emulator to youtube
See new preview videos below (hopefully Vimeo is alright)
6) Register in the Windows Phone Marketplace.
Done.

To put things in context, I had no intention of posting any videos of my WP7 side projects anytime soon. I hope (read: pray) that folks watching these videos understand that both of these games are very much in the pre-alpha / proof-of-concept state at this point, and honestly any sort of feedback at this point would be very premature.

Pre-Alpha Preview Video of Matchingo 2
This first video showing Matchingo 2 is a very rough port of the original Matchingo - this game will be getting a complete frontend overall and hopefully some pretty cool additions. The UI in the video below is 100% temporary.

Pre-Alpha Preview Video of Hungry Castaway
This second video is showing Hungry Castaway, which is in the proof-of-concept stage as well. This is the game I have been working on in both XNA and Silverlight versions, which I've referenced recently. I spent quite some time evaluating Silverlight vs XNA for this game, but I have now chosen XNA and am back to focusing on functionality.

There is a third game I am working on for WP7 as well, however it is way too early to show anything. I also would love to port ImageWind.net to WP7 - but I have to get a better understanding of if such an app can make it through the app approval process. Now that a few of the cats are out of the bag, I guess I better get back to work.. ;)