A Windows Phone 8 Project Template Without the Fluff
Introduction
After I downloaded the Windows Phone 8 SDK I noticed the first template called “Windows Phone App”. I was thinking that this template was a blank template as the image on the right hand side just shows a title and page name.
I would find out very quickly that I was wrong.
Examining the Windows Phone app Template
Upon launching it the first thing that I noticed was that the MainPage.xaml contained blocks of comments.
Even the MainPage.xaml.cs contains blocks of commented code.
But it doesn’t end there looking in the Solution Explorer we can see the following files have been added automatically that are not in use without uncommenting the code listed earlier.
- Two images under Tiles are automatically added to your project for the Iconic Tile Template while the default template is Flip.
- ApplicationGrid.png is used to help align your text to the Grid.
- Resources is used for adding additional language support.
- LocalizedStrings.cs provides access to string resources in AppResources.resx which is also not in use by default.
Also inside of this template the support for large tile is disabled while the sample large Flip Tile image is included and the SplashScreenImage.jpg has been removed.
I Know I Know
I know what you are thinking by now: this is guidance set forth by Microsoft to help developers deliver an exceptional Windows Phone 8 app. While I can’t agree more sometimes I (and I assume other developers) want a blank Windows Phone 8 project template that looks similar to this:
Noticed that I’ve removed the unnecessary tiles ApplicationGrid.png Resources folder LocalizedStrings.cs and removed the blocks of comments from MainPage.xaml and MainPage.xaml.cs. I’ve added by default support for large tile which I think is one of the best new features in Windows Phone 8 and added back the SplashScreenImage.jpg for you to brand your application again.
My Version of the Blank Windows Phone 8 Template
As you can see from the screenshot I have a template called “Windows Phone App – Blank” which has a description of “A project for creating a Windows Phone App without any boilerplate code.
Download it
The template is available here to download (C# only – sorry VB). You will need to copy the zip file to the following directory (creating directories as needed) C:\Users\<your user name>\Documents\Visual Studio 2012\Templates\ProjectTemplates\Visual C#\Windows Phone\
(Sorry I didn’t feel like creating a VSIX project)
Once you copy it over then it will look like the following in Windows Explorer:
You can now close and restart Visual Studio 2012 and see the new project template as shown earlier.
… and a Final Note
Now you have the best of both worlds… If you need the guidance provided by Microsoft then use the Windows Phone App Template. If you don’t need it (maybe for a quick demo) then use my template. Now what are you waiting for go build that next app!
Leave a Comment