Introduction To Windows Phone 7 Project Structure – [Part-2]

In this article I am going to describe Silverlight Windows Phone7 project structure. Let me introduce, basic information about the Silverlight project for Windows Phone 7.

Let’s get familiar with Silverlight

Windows Phone 7 Project Structure

Windows Phone 7 Project Structure

Why Silverlight for Windows Phone 7?
Silverlight is the application development platform for Windows Phone7, it supports core Silverlight capabilities in managed .NET code with XAML including: vector and bitmap graphics and animation, high quality video and audio streaming. In Windows Phone7 Silverlight we can also access the unique capabilities for Phone like telephone functionality, camera, multi-touch, location awareness, smooth navigation and so many compiling UI features. High performance gaming is also supported through the XNA Framework.

What is XAML?
XAML is (pronounced “zammel”) standard for eXtended Application Markup Language. XAML is an XML file, which follows the basic rules of XML. In Silverlight, XAML is used to design user interfaces and animations.

Understand the Silverlight project structure for Windows Phone7.
A Silverlight Windows Phone 7 project contains various configuration, assembly references, and code files:
1) App.xaml
2) MainPage.xaml
3) ApplicationIcon.png
4) Background.png
5) SplashScreenImage.png

Let us have a glance at the Silverlight Windows Phone 7 Project files.

1- App.xaml

App.xaml file is the application starting point, which loads the entire Silverlight application. Here we can declare shared resources, brushes, various style objects, styles, templates etc. which will be accessible in the application. The App.xaml.cs file used to handle global application level events like Application_Launching, Application_Activated, Application_Deactivated, Application_Closing, RootFrame_NavigationFailed and Application_UnhandledException.

2- MainPage.xaml

The “MainPage.xaml” is default page with some UI element. It is actually a startup UI for Silverlight application in Windows Phone 7. Here we can use the Silverlight controls for developing user interface with different layouts. The MainPage.xaml.cs file is a code-behind for the main page of an application.

3- ApplicationIcon.png

As name itself suggests, it is application icon. That icon will appear in the list of applications on the phone. This is created by default in WP7 project. Developer can change PNG image as per his/her requirement. ApplicationIcon.png is 62 x 62 pixels with 72 pixels / inch resolution.

4- Background.png

This is also an icon image; this image is displayed when the application is “pinned” to the Start screen of Windows Phone. It has 173x173pixels. In addition to pin the application onto Start screen of Windows Phone, click on the application icon and hold it, then select the “pin to start” option. The Background.png image will now appear on the Start screen.

5- SplashScreenImage.png

A splash screen is an image that appears while a program/application is loading. It also describes the introduction of application.

Note: These three (ApplicationIcon.png, Background.png, SplashScreenImage.png) files property, by default set as Build Action – “Content” AND the copy to Output Directory be set to “Copy if newer”.

In Silverlight WP7 Deployment File is called .XAP file which is the compressed output of the Silverlight Application which includes application manifest file, compiled output assembly and other resources used by your Silverlight WP7 application. I will explain how to deploy WP7 application in Windows Phone 7 Emulator or device. We will discuss later about deployment in this series.

Thank you 🙂

Advertisements

About Pavan Pareta

My name is Pavan Pareta, I enjoy computers and general technology. I am more interested in the areas of Computer Security, Programming and developing innovative s/w for Windows Mobile and Windows Phone 7. I like MS Technology and support open-source software, because I believe it plays a major role in knowledge sharing and exchange of ideas, which effectively leads to better software. Additionally, I am a follower of the KISS (Keep It Simple Stupid) philosophy. I Love C#.NET and recently I am fall in love with Silverlight :) Introduce to my machine My main workstation is a Intel Pentium Core Duo and my primary operating system is Windows 7.
This entry was posted in Windows Phone 7 and tagged . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s