Saturday, December 10, 2011

Create Window Phone Application With Microsoft Visual Stidio.

Exercise 1: Creating Windows Phone Applications with Microsoft Visual Studio 2010 Express for Windows Phone

In this exercise, you will create, test, deploy and run your first “Hello World” Silverlight for Windows Phone application. You will learn how to use the Windows Phone Developer Tools including the free Microsoft Visual Studio 2010 Express for Windows Phone IDE, and the Windows Phone Emulator.
During the exercise, you will create a new Silverlight for Windows Phone project. You start with the very basic elements of any Windows Phone application, adding basic button and text handling to the default Windows Phone project template. Since this is a Silverlight for Windows Phone application, you need to follow the Silverlight programming model and define your user interface using XAML. Although it is possible to develop an XAML-based UI using any code, it is much easier to express yourself and take advantage of good and easy tooling when you work with XAML.
To build user interfaces for the Windows Phone using XAML, you edit the XAML of the main page to add three elements: a text box, a button, and a text block. These Silverlight controls have been ported to work in the Silverlight for Windows Phone runtime environment. Once completed, the application allows you to enter a text message in the text box and then click the button to display the text you entered in the text block.
Finally, once the code is ready, you build the application and deploy it to the Windows Phone Emulator to test it. To debug applications running in the emulator, you set up a breakpoint and use the debugger to step through the source code and examine the value of the program variables.
Note:
The steps in this hands-on lab illustrate procedures using Microsoft Visual Studio 2010 Express for Windows Phone, but they are equally applicable to Microsoft Visual Studio 2010 with the Windows Phone Developer Tools. Instructions that refer generically to Visual Studio apply to both products.

Task 1 – Creating a Windows Phone Application Project in Visual Studio

In this task, you use a predefined template in Microsoft Visual Studio 2010 Express for Windows Phone to create a Silverlight for Windows Phone Application project that you can use as the starting point for your first application.
  1. Open Microsoft Visual Studio 2010 Express for Windows Phone from Start | All Programs | Microsoft Visual Studio 2010 Express | Microsoft Visual Studio 2010 Express for Windows Phone.
    Note:
    Visual Studio 2010: Open Visual Studio 2010 from Start | All Programs | Microsoft Visual Studio 2010.
  2. In theFilemenu, chooseNew Project.
    Note:
    Visual Studio 2010: In the File menu, point to New and then select Project.
  3. In theNew Project dialog, select the Silverlight for Windows Phone category in the list of installed templates, and there the Windows Phone Application template. Then set the name to HelloPhone and the location to Ex1-CreatingWP7AppsWithVisualStudio in the Source folder of the lab. Change the solution name to Begin, and then click OK.