惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
S
Security @ Cisco Blogs
T
Threat Research - Cisco Blogs
TaoSecurity Blog
TaoSecurity Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
腾讯CDC
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
Microsoft Azure Blog
Microsoft Azure Blog
罗磊的独立博客
F
Full Disclosure
博客园 - 【当耐特】
C
CERT Recently Published Vulnerability Notes
Engineering at Meta
Engineering at Meta
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Threatpost
I
Intezer
V2EX - 技术
V2EX - 技术
H
Hackread – Cybersecurity News, Data Breaches, AI and More
The Hacker News
The Hacker News
小众软件
小众软件
Google DeepMind News
Google DeepMind News
T
Tailwind CSS Blog
D
Darknet – Hacking Tools, Hacker News & Cyber Security
B
Blog RSS Feed
Microsoft Security Blog
Microsoft Security Blog
N
News | PayPal Newsroom
MyScale Blog
MyScale Blog
AI
AI
Vercel News
Vercel News
Spread Privacy
Spread Privacy
美团技术团队
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
The GitHub Blog
The GitHub Blog
V
Vulnerabilities – Threatpost
Schneier on Security
Schneier on Security
Cyberwarzone
Cyberwarzone
G
GRAHAM CLULEY
Help Net Security
Help Net Security
Hacker News: Ask HN
Hacker News: Ask HN
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
L
LINUX DO - 热门话题
U
Unit 42
L
LangChain Blog
Recent Announcements
Recent Announcements

博客园 - 张剑

WebMatrix&Razor建站系列之WebMatrix介绍 Windows Phone 7 XNA开发之关于游戏组件 Windows Phone 7 XNA开发之关于图形的配置 EntityFramework外健的读写 vs2010中添加项目中找不到EntityFramework实体框架解决办法 使用MSDN学习ASP.NET的工作流程 Windows Phone 7、XNA的旋转的背景 《XNA游戏开发》在战机游戏中使用Decorator模式 不被重视的基础,简单高效地使用ADO.net连接对象 微软2011 GCR MVP Open Day 之旅! ASP.NET4.5与VisualStudio11预览 程序员杂记系列文章,30岁之前的回忆。 程序员杂记:带面具的生活! MVC中在路由表routes集合中添加Route实例的一些问题。 MVC3+Entity Framework 实现投票系统(三) MVC3+Entity Framework 实现投票系统(二) MVC3+Entity Framework 实现投票系统(一) 关于Windows Phone 7开发工具离线安装包 程序员杂记:我们的爱情故事
Windows Phone 7之HelloWorld!
张剑 · 2011-11-28 · via 博客园 - 张剑

2011-11-28 20:18  张剑  阅读(361)  评论()    收藏  举报

在我的博客中提供了关于Windows Phone 7开发工具离线安装包的下载,接下来我们看看如何应用Microsoft Visual Studio 2010 Express for Windows Phone开发PhoneApp,首先开始当然是Hello World!

创建一个Wp7项目:

2.确认后选择目标操作系统版本:

3.项目创建完成后界面如下:

4.从以上内容,我们可以看到,WP7手机应用程序的开发,实际上就是微软在WPF/Silverlight中应用的技术,也就是XAML与C#或VB结合的一种开发模式。

5.从左边点开工具箱后,可以从工具箱拉“控件”到WP7窗体中,会自动加到ContentPanel中:

6.再拉一个Button到窗体上:

7.双击button控件,会生成控件单击事件调用的方法,并编写方法内容如下:

  1. public partial class MainPage : PhoneApplicationPage
  2. {
  3. public MainPage()
  4. {
  5. InitializeComponent();
  6. }
  7. private void button1_Click(object sender, RoutedEventArgs e)
  8. {
  9. textBlock1.Text = "Hello World!";
  10. }
  11. }

8.以上的控件中,可以更改button的Content属性或TextBlock的Text相属性初始值为自定义内容。

9.运行起来后会首先出来加载界面,与WP7的页面如下:

10.之后会运行起做好的程序,如果点击button后,会显出以下结果:

源码下载