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