Windows 7安装
目前Windows Phone 7开发环境只是支持Windows 7和Vista,我推荐使用Windows 7,下面讲述如何搭建Windows 7的环境。
准备条件
1. Windows Xp的系统。
2. 100 GB 硬盘空间
3. 2GB的内存
4. 如果要开发XNA程序的话, 显示卡支持 DirectX? 10 或者更高版本,同时带WDDM 1.1 驱动。
安装步骤
1. 下载Windows 7 ISO
2. 下载 Windows 7 USB/DVD Download Tool
到下面链接 http://store.microsoft.com/Help/ISO-Tool 下载Windows 7 USB/DVD Download Tool
3. 安装Windows 7 USB/DVD Download Tool。
格式化一个大于4G的USB盘。
运行Windows 7 USB/DVD Download Tool。
选择ISO的文件路径。
选择USB Device
选择USB盘符。
自动把ISO存放到该USB盘上。
重启机器自动进入安装程序,点击Next Next完成安装。安装程序比安装Windows XP简单,网络也不需要手工配置。就能正常使用。
Windows Phone 7开发环境安装
1.下载 Windows Phone Developer Tools CTP - April Refresh
到http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=cabcd5ed-7dfc-4731-9d7e-3220603cad14下载Windows Phone Developer Tools CTP - April Refresh,这个包含了以下所有组件,一次安装就OK了。
Visual Studio 2010 Express for Windows Phone CTP
Windows Phone Emulator CTP
Silverlight for Windows Phone CTP
XNA Game Studio 4.0 CTP
2. 点击安装vm_web.exe
点击Install Now
点击Accept,这是免费软件,enjoy it。
大概20分钟,安装完成,需要重启机器。
编写第一个Windows Phone 7程序
启动Visual Studio 2010 Express for Windows Phone
打开欢迎页面,这里有一些链接可以下载Windows Phone 7相关的文档和视频。
新建一个Window Phone Application项目,叫做HelloWorldWindowsPhone。
修改MainPage.xmal的TextBlock textBlockPageTitle 和 textBlockListTitle
Code Snippet
<!--TitleGrid is the name of the application and page title-->
<Grid x:Name="TitleGrid" Grid.Row="0">
<TextBlock Text="Hello world application" x:Name="textBlockPageTitle" Style="{StaticResource PhoneTextPageTitle1Style}"/>
<TextBlock Text="Say Hello World" x:Name="textBlockListTitle" Style="{StaticResource PhoneTextPageTitle2Style}"/>
</Grid>
增加一个按钮
Code Snippet
<!--ContentGrid is empty. Place new content here-->
<Grid x:Name="ContentGrid" Grid.Row="1">
<Button Content="Say Hi" Height="70" HorizontalAlignment="Left" Margin="144,65,0,0" Name="button1" VerticalAlignment="Top" Width="160" Click="button1_Click" />
</Grid>
增加按钮处理事件
Code Snippet
private void button1_Click(object sender, RoutedEventArgs e)
{
textBlockListTitle.Text = "Say Hi!";
}
一个demo程序就完成了。
点击F5启动Emulator进行调试
有什么不懂的大家可以一起交流哦,wp7开发交流群172765887
http://www.codewp7.com 卤面网 wp7 开发论坛
|