Create First Application for Windows Phone 7

Source: Internet
Author: User

1 Hello phone Silverlight

2.CodeDownload

 

1. Hello phone Silverlight

1.1 create a WP7 project as follows.

 

1.2 Vs will generate a project template, as shown below.

In this example, splashscreenimage.jpg is a change.ProgramShows the image used for loading.

 

Applicationicon.png is the program display icon.

 

If you are familiar with Silverlight, app. XAML and mainpage. XAML should be familiar. It is worth noting that wmappmanifest. XML is used to configure the entire WP7 application. The content of this file is as follows. It is easy to know the meaning of the Code through the English name.

<? XML version = "1.0" encoding = "UTF-8" ?>

< Deployment Xmlns = "Http://schemas.microsoft.com/windowsphone/2009/deployment" Appplatformversion = "7.0" >
< App Xmlns = "" Productid = "{3a71bca0-cecc-48e4-8d89-d0b63a2fca2e }" Title = "Silverlighthellophone" Runtimetype = "Silverlight" Version = "1.0.0.0" Genre = "Apps. Normal" Author = "Silverlighthellophone Author" Description = "Sample description" Publisher = "Silverlighthellophone" >
< Iconpath Isrelative = "True" Isresource = "False" > Applicationicon.png </ Iconpath >
< Capabilities >
< Capability Name = "Id_cap_gamerservices" />
< Capability Name = "Id_cap_identity_device" />
< Capability Name = "Id_cap_identity_user" />
< Capability Name = "Id_cap_location" />
< Capability Name = "Id_cap_medialib" />
< Capability Name = "Id_cap_microphone" />
< Capability Name = "Id_cap_networking" />
< Capability Name = "Id_cap_phonedialer" />
< Capability Name = "Id_cap_push_notification" />
< Capability Name = "Id_cap_sensors" />
< Capability Name = "Id_cap_webbrowsercomponent" />
</ Capabilities >
< Tasks >
< Defaulttask Name = "_ Default" Navigationpage = "Mainpage. XAML" />
</ Tasks >
< Tokens >
< Primarytoken Tokenid = "Silverlighthellophonetoken" Taskname = "_ Default" >
< Templatetype5 >
< Backgroundimageuri Isrelative = "True" Isresource = "False" > Background.png </ Backgroundimageuri >
< Count > 0 </ Count >
< Title > Silverlighthellophone </ Title >
</ Templatetype5 >
</ Primarytoken >
</ Tokens >
</ App >

</Deployment>  

1.3 modify the mainpage. XAML file and add the following code to contentpanel:

<! -- Contentpanel-place additional content here --> <grid X: Name = "contentpanel" grid. Row = "1" margin = "12,0, 12,0"> <Textblock X: Name = "txtblk"/> </GRID>

Modify the post-code of mainpage:

Public Mainpage ()
{
Initializecomponent ();
This . Txtblk. Text =   " Hello phone! " ;

}

1.4 click F5 to start the debugging program. The Hello phone program is so simple.

 

 

2. Download Code

/Files/xuqiang/silverlighthellophone.rar

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.