Windows Phone 8: New Project Structure

Windows Phone 8: New Project Structure

In the previous post you would have seen that you can now select with a WP7 or WP8 target when creating a new project with the Windows Phone 8 SDK. With earlier SDK versions the choice of target platform made very little difference to the project structure. Now, there are some substantial differences that you should take note of. The following images illustrate the project structure for Windows Phone 7.1 (left) and Windows Phone 8 (right) projects.

imageimage

Here’s some of my observations:

– There is no splash screen image in the template. Actually WP8 does use the same splashscreen mechanism, requiring the file SplashScreenImage.jpg. You can also provide high resolution versions of the splash screen image which need to be named appropriately (see documentation for details). My guess is that because WP8 application start up so quickly (through a combination of improved runtime and precompilation of assemblies etc), the thinking is that the splash screen is not necessary any more.

– ApplicationIcon has been moved into the Assets folder, recognising that most developers like to organise images etc into a sub folder to make it easier to manage files within a project

– Background image has been replaced by a series of tile images (in the AssetsTiles folder). WP8 supports small, regular and large tiles, as well as flip and cyclic templates. The series of tiles gives you a starting point to working with the different tile formats.

– AlignmentGrid (located in the Assets folder) is an overlay that you can display on any page to see if your controls/text align correctly. Alignment is an important aspect of fit and finish of an application, and is all too often neglected. The result is an application looks unfinished or off balance. You’ll see in MainPage.xaml that there is a element which you can uncomment in order to display this image. Note: IsHitTestVisible is set to False to ensure it doesn’t affect the way that your application operates. You should also take note of the comment in the XAML which indicates you may need to adjust the Margin depending on whether you have the SystemTray visible or not.

        <!–<Image Source="/Assets/AlignmentGrid.png" VerticalAlignment="Top" Height="800" Width="480" Margin="0,-32,0,0" Grid.Row="0" Grid.RowSpan="2" IsHitTestVisible="False" />—>

– AppResources/LocalizedStrings. With the new support for right-to-left text it’s become important for developers to know how to globalize/localize their applications. One step in Globalizing your application is moving string literals out into a resource file (ie AppResources.resx). These strings can be referenced via the wrapper class, LocalizedStrings, which is created as a static resource in App.xaml

<Application.Resources>
    <local:LocalizedStrings >image

Leave a Reply

Your email address will not be published. Required fields are marked *