Wednesday 16 March 2011

Introduction To Windows Phone 7 Project Structure

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

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. The App.xaml.cs class derives from Application class.

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. The MainPage class derives from PhoneApplicationPage class.

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.

Thanks & Regards,

"Remember Me When You Raise Your Hand For Dua"
Raheel Ahmed Khan
System Engineer
send2raheel@engineer.com
sirraheel@gmail.com

http://raheel-mydreamz.blogspot.com/
http://raheeldreamz.wordpress.com/
 

No comments:

Post a Comment

what is Juice Jacking SCAM

  Juice Jacking is a cybersecurity threat that occurs when cybercriminals manipulate public charging stations, such as USB charging ports in...