最近Xushine研究院正在研究关于Windows phone 7的一些东西~,今天给大家谈谈关于Windows Phone 7开发环境配置,虽然只是一篇介绍性的文章,但是Windows Phone 7开发之路其实就那么简单,一起来开发Windows Phone 7吧。

目前Windows Phone 7开发环境只是支持Windows 7和Vista,我推荐使用Windows 7,安装Windows7就不多少了~

安装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

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

 

增加一个按钮

 

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

 

增加按钮处理事件

private void button1_Click(object sender, RoutedEventArgs e)

{

    textBlockListTitle.Text = “Say Hi!”;

}

 

一个demo程序就完成了。

 

 

 

点击F5启动Emulator进行调试

进入我们编写的程序。

点击按钮

评论被关闭。