Self-taught Windows Phone 7

Source: Internet
Author: User

Address: http://www.cnblogs.com/tongyi/archive/2012/02/18/WindowsPhone1.html

 

 

Mobile development is a trend,ProgramI should keep learning. Now I start to learn Windows Phone 7 mobile development by myself. If you don't talk about anything else, start directly:

1. My development environment: (http://msdn.microsoft.com/zh-cn/library/ff402535%28v=vs.92%29.aspx)

* Windows 7Vdisual studio 2010 express for Windows Phone

* Install the Windows Phone SDK (Tool)

* Windows Phone emulator (simulator) can also use a Windows Phone real machine.

* Expression bleed, Silverlight, xNa

2. Basic concepts:

* Metro, zure, xNa, and Xmal

3. Create the first Windows Phone application

First look at the simulator:

* Create a project in vs 2010

Open: mainpage. XAML





<! -- Contentpanel-place other content here -->
<Grid X: Name = "contentpanel" grid. Row = "1" margin = "12,0, 12,0">
<Button content = "say hi" Height = "72" horizontalalignment = "Left" margin = "37,49, 160 "name =" button1 "verticalignment =" TOP "width =" "Click =" button#click "/>
</GRID>

Mainpage. XAML. CS

Private void button#click (Object sender, routedeventargs E)
{
Pagetitle. Text = "good morning! "; // Title
MessageBox. Show ("Welcome to Windows Phone 7 Application", "message", messageboxbutton. OK); // information box
This. navigationservice. navigate (New uri ("/second. XAML", urikind. Relative); // page Jump
}

Start debugging to see the effect:

Modification in wmappmanifest. xml

1. Set the default startup page

<Tasks>
<Defaulttask name = "_ default" navigationpage = "mainpage. XAML"/>
</Tasks>

2. Set the red box of the my first phoneapp icon

<Iconpath isrelative = "true" isresource = "false"> myico.gif </iconpath>

3. click the mouse on my first phoneapp and you can set it to start. backgroundimageuri can set the icon displayed by the program in start.

<Tokens>
<Primarytoken tokenid = "phoneapp1token" taskname = "_ default">
<Templatetype5>
<Backgroundimageuri isrelative = "true" isresource = "false"> mybackgroudimg.gif </backgroundimageuri>
<Count> 0 </count>
<Title> welcome </title>
</Templatetype5>
</Primarytoken>
</Tokens>

Well, the first Windows Phone application is basically complete. I wrote a blog for the first time, but the text and page layout were not ideal. Please forgive me and correct me. I hope to have more conversations with experts who like Windows Phone. Continue...

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.