Self-taught Windows Phone 7

Source: Internet
Author: User

Mobile development is a trend. As a programmer, I should keep learning. Now I start to learn mobile development on Windows Phone 7. 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 7 Vdisual 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

<! -- TitlePanel contains the application name and page title -->
<StackPanel x: Name = "TitlePanel" Grid. Row = "0" Margin = ",">
<TextBlock x: Name = "ApplicationTitle" Text = "My applications" Style = "{StaticResource PhoneTextNormalStyle}"/>
<TextBlock x: Name = "PageTitle" Text = "Hello World" Margin = "9,-7,0, 0" Style = "{StaticResource PhoneTextTitle1Style}"/>
</StackPanel>

<! -- 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.