Windows Phone development, hello Windows Phone! -[WP Development]

Source: Internet
Author: User
ArticleDirectory
    • I. Environment Configuration
    • 2. Hello Windows Phone!

What Sparks will Nokia + Microsoft WP7 bring out? I am very much looking forward to Windows Phone, especially Silverlight, as a language foundation for WP development, and the learning curve is much flattened. In terms of the market, competition will always be beneficial. Only high-quality applications and hardware architectures can attract users to use them, so that they can survive and make more choices, it is also a good thing for users.
The features and background of Windows Phone will not be listed, and the engine will find a lot at a moment. Record your Hello Windows Phone process.

I. Environment Configuration

First, use a toolkit to obtain all required tools. You can download and install the required tools and IDES online:

The download includes the following development components:

Run the downloaded vm_web.exe file to start the automatic download and installation process. Wait a moment before the installation is successful.

2. Hello Windows Phone!

Next we will start our "Hello Windows Phone" Program.

First, it should be easy to understand how to create a new project. VS has generated a demo for us.CodeYou are familiar with it. Hey, XAML.

Then we can see Solution Explorer:


The files and functions are described as follows:

Item Item Description
App. XAML/APP. XAML. CS: Define the entry point of the application, initialize resources within the application range, and display the application user interface;
Mainpage. XAML/mainpage. XAML. CS: Define the application page (page with user interface) in the application );
Applicationicon.png: An image file with icons represents the icons of applications in the mobile app list;
Background.png: An image file with icons represents the charts of applications on the start page;
Splashscreenimage.jpg: This image is displayed when the application is started for the first time. The startup screen will give you an immediate feedback, telling the user that the application is starting until it is successfully redirected to the first page of the application. The user's startup screen can be very similar to the design of a page of the application, so that the application can be quickly loaded.
Properties \ appmanifest. xml: An Application List file necessary to generate an application package;
Properties \ assemblyinfo. CS: Metadata containing the name and version will be embedded into the generated assembly;
Properties \ wmappmanifest. xml: A configuration file that contains specific metadata related to the Windows Phone Silverlight application and contains specific functions of Silverlight for Windows Phone;
References Folder: Lists of database files (sets) to provide functions and services for application work.

Details about the app. XAML file:

First, right-click app. XAML in Solution Explorer and select View designer. Note The XAML mark of this file. It has a root element called application and a segment named application. Resources in this root element. Here, you can define application-level resources, such as colors, brushes, and style objects used by the entire application.

This XAML code initializes the applicationlifetimeobjects attribute of the application and creates a phoneapplicationservice object. The phoneapplicationservice class provides access to applications in different stages of life. It includes management of applications in idle state, and management of applications in valid or invalid state.

Then, right-click app. XAML in Solution Explorer and select view code to open a code hidden file. Note that the constructor of the derived class of the application already has a handle for the unhandledexception event.

The rootframe attribute of the application class identifies the application startup page. All Windows Phone applications have a top-level container element whose data type is phoneapplicationframe. This framework carries one or more phoneapplicationpage elements used to identify the application content, and is also used to process navigation switching between different pages.

Note: The application class generated by Silverlight Based on the Windows Phone application template contains not only the handle to the preceding events, but also the handles to the launching and closing events. You can update the code of these methods to execute customized code when the Windows Phone application starts and closes.

Details about the mainframe. XAML file:

By default, designer will display the file in separated views. One window displays the XAML tag, and the other window displays the WYSIWYG User Interface Element Design view. The Application name and title are displayed in the template. You can delete them as needed. In addition, The XAML file provides you with a blank canvas-like operation area. You can add controls to create your own application user interface. For example:

Test and deployment:

Verify that the deployment target is for Windows Phone emulator. Make sure that the value in the select target drop-down box next to the start debugging button on the toolbar is Windows Phone 7 emulator.

If you select Windows Phone 7 device, connect to a real Windows Phone.

TIPS: tip: when you start a debugging session, it will take some time to build the simulator environment and start the application. To make the debugging process simple and effectiveSource codeDo not disable the simulator. If the simulator is always running, it takes little time to stop the current session, edit the source code, build the application, deploy a new application image, and restart the debugging session.

If there is no problem with debug, we can see our hello Windows Phone.
 

Related Development Resources

    • app hub
    • "Windows Phone 7 programming" Full ebook download
      "href =" http://download.microsoft.com/download/5/0/A/50A39509-D015-410F-A8F2-A5511E5A988D/Microsoft_Press_ebook_Programming_Windows_Phone_7_PDF.pdf "> Windows Phone 7 Programming
    • source code of Windows Phone 7 Programming
    • reference: Hands-on lab Hello Windows Phone
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.