Windows Phone开发工具初体验

openkk 10年前
     <p><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具在</span><span style="font-family:Calibri;">MIX 2010</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上火热登场了。</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发者们压抑许久的热情终于爆发出来,对于</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的华丽转身,开发者们褒贬不一,有人对</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">、</span><span style="font-family:Calibri;"> XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">等新技术充满期待,有人对放弃以前版本兼容性、不支持</span><span style="font-family:Calibri;">C++</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发满腹怨言。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">无论如何,</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">为我们带来了新的用户体验、新的开发工具,总比让开发者守着</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的老面孔,一起慢慢变老,要好吧?下面,就让我们看看</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具会为开发者们带来哪些惊喜,呃,或者惊讶。</span></p>    <p><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具的社区预览版(</span><span style="font-family:Calibri;">CTP</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">)可以在</span><span style="font-family:Calibri;">MSDN</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上下载。其中包括</span><span style="font-family:Calibri;">Visual Studio 2010 Express for Windows Phone, Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">模拟器</span><span style="font-family:Calibri;">, Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">XNA 4.0 Game Studio</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">。目前,</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具只能安装在</span><span style="font-family:Calibri;">Windows 7</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">Vista SP2</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上,还需要显卡支持</span><span style="font-family:Calibri;">DirectX 10</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">打开</span><span style="font-family:Calibri;">VS 2010</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">后,我的感觉喜忧参半,喜的是</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">提供了两种不同的开发平台:</span><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">XNA 4.0</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,忧的是,以前</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的</span><span style="font-family:Calibri;">C++</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">.NET Compact Framework</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">都用不上了。所以,以前的</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序员也要经历一个痛苦的转型过程。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">接下来,我们就看看</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">带来的双重惊喜吧!</span></p>    <h2><span style="font-size:medium;"><span style="color:#4f81bd;"><span style="font-family:Cambria;">Silverlight for Windows Phone</span></span></span></h2>    <p><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">险些沦为一个笑话,</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序员在抱怨,</span><span style="font-family:Calibri;">Symbian</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上的</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">都出来了,</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上的</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">在哪里?这次,</span><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">来了,而且所有</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上的应用必须用</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">来写。</span></p>    <p><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">最大的优势在于与</span><span style="font-family:Calibri;">Expression Blend</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的无缝整合,可以快速设计出非常漂亮的用户界面,将程序员从繁琐的</span><span style="font-family:Calibri;">UI</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发中解放出来。而且</span><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">不再是</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的子集,而是支持</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的全部功能。这样的好处是,已有的</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序很容易移植到</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">手机上。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">在程序菜单的</span><span style="font-family:Calibri;">XNA Game Studio 4.0</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">下打开</span><span style="font-family:Calibri;">VS 2010</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,创建一个新工程,在</span><span style="font-family:Calibri;">Visual C#</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">下找到三个模板,选择</span><span style="font-family:Calibri;">”Windows Phone Application”</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">。</span></p>    <p><span style="mso-no-proof:yes;"><img style="width:715px;height:457px;" alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/3e89122a396a3c063ebfe9a480d3a630.jpg" /></span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">不知道</span><span style="font-family:Calibri;">Phone List Application</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">是啥,看起来</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的界面会以</span><span style="font-family:Calibri;">List</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">为主了。点击</span><span style="font-family:Calibri;">OK</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">后,会直接进入</span><span style="font-family:Calibri;">IDE</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的主界面:</span></p>    <p><span style="mso-no-proof:yes;"><img style="width:701px;height:437px;" alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/985b239deca30c525a5633e851a3f7f8.jpg" /></span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">似曾相识,左边是工具栏,可以拖拽控件到</span><span style="font-family:Calibri;">UI</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">设计器上,与</span><span style="font-family:Calibri;">XAML</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">界面对应。根据示例程序,我准备编写一个浏览器和媒体播放器,首先是从</span><span style="font-family:Calibri;">Toolbox</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">中将</span><span style="font-family:Calibri;">MediaElement</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">WebBrowser</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">控件拖拽到</span><span style="font-family:Calibri;">UI</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">设计器上。</span></p>    <p><span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/51aa72eed139d408c72a1d2c0659692f.jpg" width="253" height="549" /></span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">为了播放多媒体文件,我们还要在</span><span style="font-family:Calibri;">Solution Explorer</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">里将</span><span style="font-family:Calibri;">wmv</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">文件添加到工程里。做法和</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">工程一致,选择</span><span style="font-family:Calibri;">Content</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">类型,</span><span style="font-family:Calibri;">wmv</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">文件会和工程一起发布。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">接下来就是编写代码了。</span><span style="font-family:Calibri;">MediaElement</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">组件需要设置</span><span style="font-family:Calibri;">Source</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">属性,然后调用</span><span style="font-family:Calibri;">Play</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">方法。而</span><span style="font-family:Calibri;">WebBrowser</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">选择</span><span style="font-family:Calibri;">Navigate</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">方法来访问指定网站。</span></p>    <p></p>    <pre class="brush:c#; toolbar: true; auto-links: false;">private void button1_Click(object sender, RoutedEventArgs e) {     textBlockListTitle.Text = textBox1.Text;      if (Convert.ToBoolean(checkBox1.IsChecked))     {         webBrowser1.Visibility = Visibility.Collapsed;         mediaElement1.Visibility = Visibility.Visible;         // play Video         mediaElement1.Source = new Uri("Wildlife.wmv", UriKind.Relative);         mediaElement1.Position = TimeSpan.FromMilliseconds(0);         mediaElement1.Play();     }     else     {         mediaElement1.Visibility = Visibility.Collapsed;         webBrowser1.Visibility = Visibility.Visible;          // Browser         webBrowser1.Navigate(new Uri(textBox1.Text, UriKind.Absolute));     } }</pre>    <p></p>    <p><span style="font-family:Consolas;font-size:9.5pt;"> </span></p>    <p><span style="font-family:Calibri;"> </span></p>    <p><span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/7c3418c31b062806f48ef71b95c8ab5e.png" width="308" height="174" /></span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">代码编辑完成后,选择</span><span style="font-family:Calibri;">Windows Phone Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">作为目标设备。直接按</span><span style="font-family:Calibri;">F5</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,</span><span style="font-family:Calibri;">Windows Phone Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">会被启动。</span></p>    <p><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">类库中增加了很多</span><span style="font-family:Calibri;">Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">独有的功能。</span><span style="font-family:Calibri;">Microsoft.Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的命名空间下,包括</span><span style="font-family:Calibri;">Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">、电话本、电子邮件、</span><span style="font-family:Calibri;">Camera</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">、</span><span style="font-family:Calibri;">Bing</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">地图、</span><span style="font-family:Calibri;">Marketplace</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">、浏览器和搜索等功能。</span><span style="font-family:Calibri;">Microsoft.Device.Sensors</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">中包括各种各样的传感器,其中包括重力感应。</span><span style="font-family:Calibri;">Silverlight</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">中还包括了</span><span style="font-family:Calibri;">Location</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">Push Notification</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">等独有功能。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">我的程序运行起来就是下面这个样子。程序带有强烈的</span><span style="font-family:Calibri;">Zune</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">风格,不但有标题,而且还有明显的</span><span style="font-family:Calibri;">Block List Title</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">。另外就是输入法,带有明显</span><span style="font-family:Calibri;">iPhone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的痕迹,不过对电容屏的支持看来不是问题了。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">我还没有仔细看</span><span style="font-family:Calibri;">Windows Phone Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的实现机制,不过从启动速度来看,绝对不是把整个</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">放在模拟器里执行了。原来</span><span style="font-family:Calibri;">Windows Device Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">那个基于三星</span><span style="font-family:Calibri;">2410</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的小身板估计也跑不起来。反正也是</span><span style="font-family:Calibri;">Managed Code</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,估计又是</span><span style="font-family:Calibri;">JIT</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">编译那套。恍惚间,仿佛回到了</span><span style="font-family:Calibri;">Pocket PC 2002</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的年代。</span></p>    <p><span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/94779c4084f71e0c3b2e962896bd2903.jpg" width="376" height="750" /> </span><span style="line-height:115%;font-family:Consolas;font-size:9.5pt;mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/b1054a67660f4dffb11f74620067812a.jpg" width="378" height="755" /> <span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/313c16d9105dcd66f98c2e0866382d17.jpg" width="377" height="753" /></span></span></p>    <p><span style="font-family:Calibri;"> </span></p>    <h2><span style="font-size:medium;"><span style="color:#4f81bd;"><span style="font-family:Cambria;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Cambria;mso-ascii-theme-font:major-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:major-fareast;mso-hansi-font-family:Cambria;mso-hansi-theme-font:major-latin;">新界面</span></span></span></h2>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">既然把</span><span style="font-family:Calibri;">Windows Phone Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">起来了,我们就顺便参观下</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的新界面吧。点左边的</span><span style="font-family:Calibri;">Back</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">键,会将应用程序的</span><span style="font-family:Calibri;">Debugger</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">断掉,不知道程序是否退出了。点中间的</span><span style="font-family:Calibri;">Win Button</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,会回到主界面。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">不过主界面上只有</span><span style="font-family:Calibri;">IE</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">一个图标。</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">模拟器中还没有包括其他的系统功能,比如电话、电子邮件、搜索等。模拟器也没有办法模拟重力感应、</span><span style="font-family:Calibri;">Location</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">定位服务。希望到</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具正式发布时,这些系统功能都可以被支持。</span></p>    <p><span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/eb6e69a764f5416dab0114e12e79bf90.jpg" width="379" height="755" /> <img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/868918bb87cf8c5d46423830f1f01c0b.jpg" width="379" height="748" /> <img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/8286d3bf02fba6e49c112694d59108dd.jpg" width="378" height="752" /></span></p>    <p><span style="font-family:Calibri;">IE</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的用户体验非常好,一开始新手发蒙,没找到地址栏,后边就非常顺利了。无论是页面缩放时的平滑动画,还是输入时切换到适当大小的设计,都非常顺手。特别是</span><span style="font-family:Calibri;">Multi-Tab</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的设计,感觉非常舒服。特意试了</span><span style="font-family:Calibri;">Google Map</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,显示一切正常。智能手机时代,有一个好的浏览器,其实就成功了一半。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">哦,还有一点,我在</span><span style="font-family:Calibri;">Windows Phone Emulator</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">里没有做任何配置,就可以上网了。</span></p>    <h2><span style="font-size:medium;"><span style="color:#4f81bd;"><span style="font-family:Cambria;">XNA 4.0</span></span></span></h2>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">在移动开发界,</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">还不是一个响亮的名字,但是在游戏开发界,</span><span style="font-family:Calibri;">Xbox 360</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上的</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">则是泰山北斗级的开发技术。</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">不仅仅是一个</span><span style="font-family:Calibri;">.NET</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的游戏开发平台,还包括了很多支持</span><span style="font-family:Calibri;">Xbox Live</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">服务的功能,比如,</span><span style="font-family:Calibri;">Avatars</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">技术支持在游戏中显示用户设计的形象。希望这项技术能够和同名电影一样,改变移动游戏开发的历史。</span></p>    <p><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">支持的是</span><span style="font-family:Calibri;">XNA 4.0</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">,与</span><span style="font-family:Calibri;">Zune HD</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">上的</span><span style="font-family:Calibri;">XNA 3.1</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">有啥区别?支持</span><span style="font-family:Calibri;">3D</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">游戏!目前我们看到的这个</span><span style="font-family:Calibri;">XNA 4.0</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">预览版只支持</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发,不支持</span><span style="font-family:Calibri;">Windows</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">和</span><span style="font-family:Calibri;">Xbox 360</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的游戏开发。</span></p>    <p><span style="font-family:Calibri;">Silverlight for Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">是典型的事件驱动型应用程序。而</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">是由时间驱动的应用程序,这也是游戏开发技术的典型特点。每隔固定时间,系统会触发</span><span style="font-family:Calibri;">Update</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">事件,使程序得以更新。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">不那么多废话了,创建个</span><span style="font-family:Calibri;">XNA 4.0</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的新工程吧!</span></p>    <p><span style="mso-no-proof:yes;"><img style="width:695px;height:478px;" alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/434628599bb5cea2c0dc35df5d15f25b.jpg" /></span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">选择</span><span style="font-family:Calibri;">Windows Phone Game</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">就好了。</span><span style="font-family:Calibri;">IDE</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">环境下没有界面编辑器,需要程序员通过代码来实现</span><span style="font-family:Calibri;">UI</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">。</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序的结构非常简单,程序员只需要实现几个简单的方法,就可以实现一个简单的</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序了。这些方法包括</span><span style="font-family:Calibri;">Initialize</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">初始化方法、</span><span style="font-family:Calibri;">LoadContent</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">加载文件、</span><span style="font-family:Calibri;">Update</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">更新内容和</span><span style="font-family:Calibri;">Draw</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">绘制等方法。下面是示例代码片段:</span></p>    <p></p>    <pre class="brush:c#; toolbar: true; auto-links: false;">protected override void LoadContent() {     // Create a new SpriteBatch, which can be used to draw textures.     spriteBatch = new SpriteBatch(GraphicsDevice);     texture1 = Content.Load                        <texture2d>                              ("winphone");     texture2 = Content.Load                              <texture2d>                                    ("winphone");      soundEffect = Content.Load                                    <soundeffect>                                          ("Windows Ding");      spritePosition1.X = 0;     spritePosition1.Y = 0;      spritePosition2.X = graphics.GraphicsDevice.Viewport.Width - texture1.Width;     spritePosition2.Y = graphics.GraphicsDevice.Viewport.Height - texture1.Height;      sprite1Height = texture1.Bounds.Height;     sprite1Width = texture1.Bounds.Width;      sprite2Height = texture2.Bounds.Height;     sprite2Width = texture2.Bounds.Width;  } // LoadContent方法中使用Content.Load方法来加载资源文件,这些文件也是作为资源被加载到XNA程序中的。  protected override void Update(GameTime gameTime) {     // Allows the game to exit     if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)         this.Exit();      // Move the sprite around.     UpdateSprite(gameTime, ref spritePosition1, ref spriteSpeed1);     UpdateSprite(gameTime, ref spritePosition2, ref spriteSpeed2);     CheckForCollision();      base.Update(gameTime); } // Update方法负责更新元素的位置,进行碰撞检测。如果后退键被按下,则退出程序。  protected override void Draw(GameTime gameTime) {     GraphicsDevice.Clear(Color.CornflowerBlue);      // TODO: Add your drawing code here     // Draw the sprite.     spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.AlphaBlend);     spriteBatch.Draw(texture1, spritePosition1, Color.White);     spriteBatch.End();      spriteBatch.Begin(SpriteSortMode.BackToFront, BlendState.Opaque);     spriteBatch.Draw(texture2, spritePosition2, Color.AliceBlue);     spriteBatch.End();      base.Draw(gameTime); }                                    </soundeffect>                              </texture2d>                        </texture2d></pre>    <p></p>    <br />    <p></p>    <p><span style="font-family:Calibri;">Draw</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">方法对更新后的元素进行绘制。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">我们的第一个</span><span style="font-family:Calibri;">XNA</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">程序会显示两张图片,这两张图片会在屏幕中运行,运行到边缘时,会反弹回来。</span></p>    <p><span style="font-family:Calibri;"> </span></p>    <p><span style="mso-no-proof:yes;"><img alt="Windows Phone开发工具初体验" src="https://simg.open-open.com/show/71025baa46a1e60bbd82eff5806f52ca.jpg" width="381" height="751" /></span></p>    <h2><span style="font-size:medium;"><span style="color:#4f81bd;"><span style="font-family:SimSun;mso-ascii-font-family:Cambria;mso-ascii-theme-font:major-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:major-fareast;mso-hansi-font-family:Cambria;mso-hansi-theme-font:major-latin;">写在最后</span></span></span></h2>    <p><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">开发工具不是完美无缺的,比如</span><span style="font-family:Calibri;">Visual Studio</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">启动调试程序的时间比较长,希望这是模拟器的问题,在</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">设备上不是这样。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">写完这篇文章,心中最多的还是感慨,我们不应该将</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">视作</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的升级了,这是一个全新的手机操作系统。</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的功能可能没有</span><span style="font-family:Calibri;">Windows Mobile</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">丰富,但是他赢得喝彩,靠的只有四个字——用户体验。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">凤凰涅磐,</span><span style="font-family:Calibri;">Windows Phone</span><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">的路还很长,但是我们这些紧紧追随的开发者们,要得不就是对未来的一丝憧憬吗。</span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;"><br /> </span></p>    <p><span style="font-family:SimSun;mso-ascii-font-family:Calibri;mso-ascii-theme-font:minor-latin;mso-fareast-font-family:SimSun;mso-fareast-theme-font:minor-fareast;mso-hansi-font-family:Calibri;mso-hansi-theme-font:minor-latin;">来源:http://www.cnblogs.com/aawolf/archive/2010/08/28/1811438.html</span></p>