<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/">
<channel>
<title><![CDATA[Windows Phone 开发笔记]]></title>
<link><![CDATA[http://www.itivy.com/wp7]]></link>
<description><![CDATA[]]></description>
<language><![CDATA[zh-cn]]></language>
<copyright><![CDATA[]]></copyright>
<webMaster><![CDATA[]]></webMaster>
<generator><![CDATA[]]></generator>
<Image><![CDATA[]]></Image>
<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/14/634726364456126845.html]]></link>
<title><![CDATA[微软把Metro主题引入到了jQuery Mobile和 Windows Phone]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Mon, 14 May 2012 23:54:51 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[<h2><a href="/Upload/EditorImage/image/wp7/201205/634726357976144351images-2.jpg"><img class="alignleft size-full wp-image-2835" title="images (2)" src="/Upload/EditorImage/image/wp7/201205/634726357976144351images-2.jpg" alt="" width="300" height="168" /></a>获得微软开放公司的许可后网站和移动app就可以使用Metro样</h2>
<p>微软开放技术公司已经使Metro样式主题可以在开源移动UI框架jQuery Mobile上使用，这样，Windows Phone 7.5 操作系统上的应用就可以采用Metro界面风格。</p>
<p>Metro本来是为Windows 8 操作系统而设计的平板电脑界面风格，但它同时也可用于Windows Phone。JQuery是一个利用HTML5和jQuery JavaScript库进行触摸优化的框架。  微软开放技术公司的项目经理Abu Obeida Bakhach，在上周的博文中写到：“该主题使Windows Phone 7.5上的HTML5页面可以自动适应于Metro设计风格”。微软副总裁S. Somasegar也在最近的播客中称“网站及基于HTML5的移动应用都应该使用Metro风格。”</p>
<p><span id="more-2829"></span></p>
<p>CSS和基于JavaScript的Metro主题与Windows Phone中的主题相适应，并且适用于jQuery Mobile的操控方式。HTML5的移动网站也可以适应于Windows Phone的Metro样式用户体验。</p>
<p>Bakhach说：“开发者可以利用新的开源工具<a href="http://sgrebnov.github.com/jqmobile-metro-theme/samples/jqm-public-demo/" target="_blank">Metro-style theme for jQuery Mobile</a>使他们的移动app和网站具有Metro风格的外观和感觉，最终给用户的感觉就如同是本地应用一样。”</p>
<p>开发者可以从<a href="http://sgrebnov.github.com/jqmobile-metro-theme/" target="_blank">Github</a>下载主题，在Visual Studio IDE中以NuGet扩展包的形式来使用之。该新主题是由微软的子公司微软开放技术研发的，该子公司成立于4月份，专注于互操作性研究。</p>
<p>作者：<a href="http://www.infoworld.com/author-bios/paul-krill">Paul Krill</a>，发表于2012年4月30日</p>
<p>译者：林建光</p>
<p>原文链接：</p>
<p><a href="http://www.infoworld.com/d/application-development/microsoft-links-metro-theme-jquery-mobile-windows-phone-191994">http://www.infoworld.com/d/application-development/microsoft-links-metro-theme-jquery-mobile-windows-phone-191994</a></p>

<table class="wumii-related-items" cellspacing="0" cellpadding="3" border="0"  style="clear: both;">
    
    <tr>
        <td colspan="4"><b><font size="-1"  style="display: block !important; padding: 20px 0 5px !important;">您可能也喜欢：</font></b></td>
    </tr>
    
        <tr>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important;">
                    <a target="_blank" title="PhoneGap开发初体验：用HTML5技术开发本地应用" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.webapptrend.com%2F2011%2F11%2F274.html&from=http%3A%2F%2Fwww.webapptrend.com%2F2012%2F05%2F2829.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="/Upload/EditorImage/image/wp7/201205/63472635797799950013493621.png" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">PhoneGap开发初体验：用HTML5技术开发本地应用</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="HTML5移动App剖析" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.webapptrend.com%2F2011%2F12%2F780.html&from=http%3A%2F%2Fwww.webapptrend.com%2F2012%2F05%2F2829.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="/Upload/EditorImage/image/wp7/201205/63472635797930267812146072.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">HTML5移动App剖析</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="你需要的真是移动App吗？还是一个更好的网站？" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.webapptrend.com%2F2012%2F01%2F1501.html&from=http%3A%2F%2Fwww.webapptrend.com%2F2012%2F05%2F2829.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="/Upload/EditorImage/image/wp7/201205/63472635798000755514015347.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">你需要的真是移动App吗？还是一个更好的网站？</font>
                    </a>
                </td>
                <td width="102" valign="top" style="padding: 5px !important; margin: 0 !important; border-left: 1px solid #DDDDDD !important;">
                    <a target="_blank" title="移动设备上的Web应用程序标准：2011年8月发展现状以及未来规划（上）" style="text-decoration: none !important; cursor: pointer !important;" href="http://app.wumii.com/ext/redirect?url=http%3A%2F%2Fwww.webapptrend.com%2F2011%2F11%2F151.html&from=http%3A%2F%2Fwww.webapptrend.com%2F2012%2F05%2F2829.html">
                        <img style="margin: 0 !important; padding: 2px !important; border: 1px solid #DDDDDD !important; width: 96px !important; height: 96px !important;" src="/Upload/EditorImage/image/wp7/201205/63472635798293488913493899.jpg" width="96px" height="96px" /><br />
                        <font size="-1" color="#333333" style="display: block !important; line-height: 15px !important; width: 102px !important; font: 12px/15px arial !important; height: 60px !important; margin: 3px 0 0 0 !important; padding: 0 !important; overflow: hidden !important;">移动设备上的Web应用程序标准：2011年8月发展现状以及未来规划（上）</font>
                    </a>
                </td>
        </tr>
    
    <tr>
        <td colspan="4" align="right">
            <a style="text-decoration: none !important;" href="http://www.wumii.com/widget/relatedItems" target="_blank" title="无觅相关文章插件">
                <font size="-1" color="#bbbbbb" style="display: block !important; font-family: arial !important; padding: 5px 0 !important; font-size: 12px !important; color: #bbb !important;">无觅</font>
            </a>
        </td>
    </tr>
</table><div>来源：http://www.webapptrend.com/2012/05/2829.html</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/14/634726358880326270.html]]></link>
<title><![CDATA[Silverlight游戏研发手记：(七)向Windows Phone移植之双向交互]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Mon, 14 May 2012 23:45:05 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p style="color:rgb(35, 35, 35);">继完成游戏主体框架搭建后，接下来我将通过SL.XNA模式中Silverlight控件与XNA对象之间双向交互操作的例子，向大家进一步讲解框架的拓展使用及简单的承载演示。在此之前大家需要理解Windows Phone移动设备与传统桌面设备在操作方面的差异。</p><p style="color:rgb(35, 35, 35);">直观上看，桌面应用大多使用鼠标加键盘的操作方式：鼠标左键、中键、右键，包括单击(按下、放开)、双击以及滑动、拖动、滚动等；而Windows Phone的操作方式则以<a href="http://www.devdiv.com/Windows_Phone%E8%A7%A6%E6%91%B8%E5%B1%8F-%E8%BE%93%E5%85%A5%E5%A4%84%E7%90%86-article-3329-1.html" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">触控</span></a>加<a href="http://www.cnblogs.com/liulunet/archive/2012/02/21/2361883.html" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">虚拟键盘</span></a>为主：按下、放开、按住滑动、各种(多指)手势等；当然，也可以实现像NDS那样通过麦克风实现<a href="http://www.gamehome.tv/Article/nds/200906/2381.shtml" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">语音与游戏的交互</span></a>。而Windows Phone游戏开发中则触摸以为主要输入方式，下面我将分开讲解各种触控操作在Windows Phone中的代码实现。</p><p align="left" style="color:rgb(35, 35, 35);"><strong>一、XNA中的触控操作</strong></p><p align="left" style="color:rgb(35, 35, 35);">在此之前，很有必要向新手朋友们简要阐述一下XNA的运行机制：XNA是通过传统的轮询(循环)方式呈现游戏的，即每秒钟对游戏逻辑进行N次<strong>数据更新</strong>(Update)并将对象重新<strong>绘制到屏幕上</strong>(Draw),这个频率N在代码中的设定为timer.UpdateInterval =&nbsp;<span style="color:rgb(43, 145, 175);">TimeSpan</span>.FromTicks(333333);&nbsp;即30fps(30帧每秒)。</p><p align="left" style="color:rgb(35, 35, 35);">举个例子：假如我们想让一名战士从(0,0)坐标向(300,300)坐标移动，若该战士的移动速度系数Speed=5，那么我们只需在Update()方法中让他的位置属性(X,Y)分别加上Speed(X+Speed,Y+Speed)，于是两秒钟后战士将到达目的地(X+2*5*30，Y+2*5*30)=(300,300)。根据前面所述游戏循环机制，每执行Update数据一次，屏幕就会擦除掉之前的画面然后重新Draw新的画面，于是在这两秒钟内，战士的位置会发生2*30=60次变化，依次为(0,0),(5,5),(10,10),(15,15)……(295,295),(300,300)。短短2秒钟的时间里战士位置连续变化了60次，游戏屏幕好比黑板一样，擦了60次，又画了60次，由于频率很高，好比电视欺骗人眼球同样原理，呈现的是一种连续的动态效果，最终便形成了游戏意义上的“战士移动”动画。</p><p align="left" style="color:rgb(35, 35, 35);"><img border="0" alt="" src="/Upload/EditorImage/image/wp7/201205/6347263523856265600.jpg" width="976" longdesc="http://www.cnblogs.com/alamiye010/archive/2012/04/11/2442058.html" height="570" /></p><p align="left" style="color:rgb(35, 35, 35);">由此我们可以明确：XNA中无论编写什么都必须基于循环，因此XNA模式中无论是低级触控(按下、放开、按住滑动)还是高级(路由)手势，都得<a href="http://msdn.microsoft.com/zh-cn/windowsphone/gg490792" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">放在游戏循环（Update）中进行时时的监测(轮询式)</span></a>：</p><div style="color:rgb(35, 35, 35);"><img id="code_img_closed_6c9e8602-bb1f-4702-bd39-28768ff35e89" src="/Upload/EditorImage/image/wp7/201205/634726352386119494ContractedBlock.gif" alt="" />XNA 触控</div><p align="left" style="color:rgb(35, 35, 35);">&nbsp;</p><p align="left" style="color:rgb(35, 35, 35);">&nbsp;&nbsp;&nbsp;&nbsp;如果还不能理解XNA的游戏循环原理，大家不妨将游戏循环频率设定为每3秒/次，再进一步测试XNA中触控操作，是否发现了什么？</p><p align="left" style="color:rgb(35, 35, 35);"><strong>二、Silverlight控件的触控操作</strong></p><p align="left" style="color:rgb(35, 35, 35);">如果你是一位Silverlight(Web)开发者，你会发现Windows Phone中的Silverlight控件相当给力(以Image控件为例)：</p><p align="left" style="color:rgb(35, 35, 35);"><img border="0" alt="" src="/Upload/EditorImage/image/wp7/201205/6347263523922398231.jpg" width="222" longdesc="http://www.cnblogs.com/alamiye010/archive/2012/04/11/2442058.html" height="594" /></p><p align="left" style="color:rgb(35, 35, 35);">图中所有框住的事件均为路由触控事件，且慢，居然还有Mouse……事件，刹那间泪崩了，这不是BUG，我反正信了。就如智能感知提示的那样：Mouse这一系列事件是“触笔的笔尖接触屏幕”时发生的，类比桌面鼠标事件。而其余紫色框住的部分则为Windows Phone专有触控事件，其中Tap、DoubleTap、Hold和XNA中的一致，剩下的手势则可<a href="http://msdn.microsoft.com/zh-cn/magazine/gg650664.aspx" target="_blank" style="color:rgb(24, 72, 185);">通过3个Manipulation连锁事件自由实现</a>，灵活度相当高。此时或有有朋友会问：同样是路由的MouseLeftButtonDown和Tap到底有何区别？不妨拿起你手中的Windows Phone测试一下不就知道啦&nbsp;^ ^</p><p align="left" style="color:rgb(35, 35, 35);">当然，<a href="http://www.devdiv.com/Windows_Phone%E8%A7%A6%E6%91%B8%E5%B1%8F-%E8%BE%93%E5%85%A5%E5%A4%84%E7%90%86-article-3329-1.html" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">Silverlight同样也拥有类似XNA中的非路由低级触控</span></a>。于是我将以上关于XNA与Silverlight的触控操作进行最终整合，以代码的形式封装成一个名为<span style="color:rgb(43, 145, 175);">InputHandler</span>（输入处理器)的类，内置了Silverlight与XNA的所有触控操作(注意了，如果使用该类中的XNA模式触控必须将MonitorTouch()和MonitorGestures()两个方法放置于主循环的Update()中方能起效)：</p><div style="color:rgb(35, 35, 35);"><img id="code_img_closed_1d239a08-d8e5-424f-ab0f-c2d2616c084f" src="/Upload/EditorImage/image/wp7/201205/634726352386119494ContractedBlock.gif" alt="" />InputHandler</div><p style="color:rgb(35, 35, 35);">&nbsp;</p><p style="color:rgb(35, 35, 35);">最后经过反复的对比测试，得出以下结论：Silverlight模式在触控方面与XNA最大优势在于：<a href="http://msdn.microsoft.com/zh-cn/magazine/gg650664.aspx" target="_blank" style="color:rgb(24, 72, 185);">Silverlight的触控是基于事件驱动的(触发式)，是同步的。</a>显而易见，针对低级触控操作，Silverlight模式性能更高；相对于具体控件，Silverlight触控事件效率更高，使用更方便；总体来说，不论是精确度、灵活度还是开发效率和维护效率，Silverlight触控模式都明显优于XNA模式。</p><p style="color:rgb(35, 35, 35);">因此，这也是为什么微软会在WP7.1开始重点推出SL.XNA模式的主要原因了：SL负责游戏的UI部分，而XNA则负责绘制游戏对象，分工明确，效率与性能兼具。</p><p style="color:rgb(35, 35, 35);">为了精确论证以上观点的完美可执行性，我特意编写了一个SL控件与XNA精灵交互的Demo：</p><p style="color:rgb(35, 35, 35);"><img border="0" alt="" src="/Upload/EditorImage/image/wp7/201205/6347263524051896562.jpg" width="975" longdesc="http://www.cnblogs.com/alamiye010/archive/2012/04/11/2442058.html" height="693" /></p><p style="color:rgb(35, 35, 35);">如上图，不仅有2D精灵，也有3D骨骼动画模型；有Silverlight按钮(UI)，也有XNA按钮(UI)；所有对象均同屏显示，且可相互操作(封装了一个名为<span style="color:rgb(43, 145, 175);">UIHandler</span>的UI管理类，详见本文结尾处源码)。以最左边“SL控件+XNA 2D精灵”的“转向”交互为例，首先我们赋予XNA精灵一个Direction属性：</p><div style="color:rgb(35, 35, 35);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(128, 128, 128);">///</span><span style="color:rgb(0, 128, 0);">&nbsp;</span><span style="color:rgb(128, 128, 128);">&lt;summary&gt;</span><span style="color:rgb(0, 128, 0);"><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:rgb(128, 128, 128);">///</span><span style="color:rgb(0, 128, 0);">&nbsp;获取或设置朝向<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color:rgb(128, 128, 128);">///</span><span style="color:rgb(0, 128, 0);">&nbsp;</span><span style="color:rgb(128, 128, 128);">&lt;/summary&gt;</span><span style="color:rgb(128, 128, 128);"><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(0, 0, 255);">public</span>&nbsp;<span style="color:rgb(0, 0, 255);">virtual</span>&nbsp;Directions&nbsp;Direction&nbsp;{&nbsp;<span style="color:rgb(0, 0, 255);">get</span>;&nbsp;<span style="color:rgb(0, 0, 255);">set</span>;&nbsp;}</div><p style="color:rgb(35, 35, 35);">&nbsp;</p><p style="color:rgb(35, 35, 35);">当点击“转向”Button时，触发Click事件修改该精灵的Direction属性：</p><div style="color:rgb(35, 35, 35);">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;button.Click&nbsp;+=&nbsp;<span style="color:rgb(0, 0, 255);">delegate</span>&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(0, 0, 255);">int</span>&nbsp;direction&nbsp;=&nbsp;(<span style="color:rgb(0, 0, 255);">int</span>)role1.Direction&nbsp;+&nbsp;<span style="color:rgb(128, 0, 128);">1</span>;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;role1.Direction&nbsp;=&nbsp;direction&nbsp;&gt;&nbsp;<span style="color:rgb(128, 0, 128);">3</span>&nbsp;?&nbsp;<span style="color:rgb(128, 0, 128);">0</span>&nbsp;:&nbsp;(Directions)direction;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;};</div><p style="color:rgb(35, 35, 35);">&nbsp;</p><p style="color:rgb(35, 35, 35);">同时，该精灵的Direction属性新值重新反馈给Silverlight的TextBlock控件并显示出来:</p><div style="color:rgb(35, 35, 35);">&nbsp;textBlock.Text&nbsp;=&nbsp;((Directions)role1.Direction).ToString();</div><p align="left" style="color:rgb(35, 35, 35);">&nbsp;</p><p align="left" style="color:rgb(35, 35, 35);">由此便完成了SL -&gt; XNA –&gt; SL这样一个双向交互的演示。从该案例中大家是否体会到了Silvelight UI和XNA Sprite之间的亲密无间？当然了，SL与XNA 3D对象的交互也同样方便快捷（详见源码），不过需要注意一点，在绘制模型代码段中必须加入以下三句话方能正常显示(否则会出现因与<span style="font-family:Times New Roman;">SpriteBatch</span>混合作用而导致的贴图呈现部分透明状态<span style="font-family:Times New Roman;">)</span>：</p><div style="color:rgb(35, 35, 35);"><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(0, 128, 0);">//</span><span style="color:rgb(0, 128, 0);">呈现模型蒙皮网格</span><span style="color:rgb(0, 128, 0);"><br /></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(0, 0, 255);">foreach</span>&nbsp;(ModelMesh&nbsp;mesh&nbsp;<span style="color:rgb(0, 0, 255);">in</span>&nbsp;currentModel.Meshes)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:rgb(0, 0, 255);">foreach</span>&nbsp;(SkinnedEffect&nbsp;effect&nbsp;<span style="color:rgb(0, 0, 255);">in</span>&nbsp;mesh.Effects)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;......&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; effect.GraphicsDevice.BlendState&nbsp;=&nbsp;BlendState.AlphaBlend;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;effect.GraphicsDevice.DepthStencilState&nbsp;=&nbsp;DepthStencilState.Default;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;effect.GraphicsDevice.SamplerStates[<span style="color:rgb(128, 0, 128);">0</span>]&nbsp;=&nbsp;SamplerState.PointClamp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ......<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</div></div><p align="left" style="color:rgb(35, 35, 35);">&nbsp;</p><p align="left" style="color:rgb(35, 35, 35);">至于纯XNA界面与XNA精灵的交互例子我就不再多说了，开发过XNA的朋友都清楚，需要将UI绘制出来后时时判断触控点与各UI间的位置关系最终做出判断，代码量大，编码繁琐；总之XNA做UI吃力不讨好，巨蛋痛，真的。</p><p align="left" style="color:rgb(35, 35, 35);">结尾，我认为很有必要提醒大家一下关于游戏开发中使用非常广泛的<span style="color:rgb(43, 145, 175);">Point</span>结构体和<span style="color:rgb(43, 145, 175);">Math</span>数学库。WPF/Silverlight/XNA中的<span style="color:rgb(43, 145, 175);">Point</span>设计各不相同，移植时需特别注意；System.<span style="color:rgb(43, 145, 175);">Math</span>和Microsoft.Xna.Framework.<span style="color:rgb(43, 145, 175);">MathHelper</span>针对的领域各不相同，前者在三角函数方面更全面(double)，如正弦、余弦、正切、余切等；而后者则主要针对float类型的计算，比如弧度和角度之间的换算等常用的静态方法。</p><p align="left" style="color:rgb(35, 35, 35);">&nbsp;&nbsp;&nbsp;&nbsp;OK，至此我们摸透了SL.XNA中各元素的操控原理与实现，下一节我将对第5节的Demo进行移植，进而向大家展示该框架强而有力的实用性，敬请关注。</p><p style="color:rgb(35, 35, 35);">本节源码下载地址：<a href="http://files.cnblogs.com/alamiye010/SLXnaGame2.zip" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;">SLXnaGame2.zip</span></a></p><p style="color:rgb(35, 35, 35);"><strong>手记小结：</strong>SL.XNA模式乃集大成者，无论开发2D或是3D游戏，Silverlight负责制作UI高效且便捷，XNA则专业绘制高性能精灵与模型，分工明确，结构合理，互利互补。掌握好SL.XNA开发模式，深刻透析游戏结构布局，分工合作处理好游戏各环节逻辑关系，游戏整体“效率”与“性能”必将最大化。</p><p style="color:rgb(35, 35, 35);"><strong>推荐参考：</strong><a href="http://cnblogs.com/nowpaper" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">Nowpaper</span></a>和<a href="http://www.cnblogs.com/wangergo" target="_blank" style="color:rgb(24, 72, 185);"><span style="font-family:Times New Roman;color:#0000ff;">Williams</span></a>关于Windows Phone的游戏开发博客。</p>
            
                    <div>来源：http://blog.csdn.net/alamiye010/article/details/7449299</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571695916013.html]]></link>
<title><![CDATA[Windows Phone - 各种Uri]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:10:08 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<p>今天被几个Uri搞晕，记录在案，备忘：</p>

<p>1. ApplicationBarIconButton 的Icon Uri: 所引用的Image的Build Action属性必须是"Content"</p>
<p style="padding-left: 30px;"><em>The URI must point to a file in the application directory. When adding an image file to an project using Windows&nbsp;Phone&nbsp;Developer&nbsp;Tools, you must set the&nbsp;<span><span class="input">Build Action</span></span>&nbsp;property to &ldquo;Content&rdquo;. Using the default value &ldquo;Resource&rdquo; will not allow the image to be accessed or displayed. - from <a href="http://msdn.microsoft.com/en-us/library/microsoft.phone.shell.applicationbariconbutton.iconuri(v=vs.92).aspx">msdn</a></em></p>

<p>且Uri开头须使用反斜杠:</p>

<p><textarea cols="50" rows="15" name="code" class="xhtml">&lt;phone:PhoneApplicationPage.ApplicationBar&gt;
        &lt;shell:ApplicationBar IsVisible="True" IsMenuEnabled="True"&gt;
            &lt;shell:ApplicationBarIconButton IconUri="/Assets/images/new.png" Text="new list"/&gt;
            &lt;shell:ApplicationBarIconButton IconUri="/Assets/images/help.png" Text="help" x:Name="btnHelp" Click="btnHelp_Click"/&gt;
            &lt;shell:ApplicationBarIconButton IconUri="/Assets/images/email.png" Text="feedback"/&gt;
        &lt;/shell:ApplicationBar&gt;
    &lt;/phone:PhoneApplicationPage.ApplicationBar&gt;</textarea>&nbsp;</p>

<p>2. WebBrower控件显示本地Html文件内容，使用如下代码：</p>
<p><span style="font-family: monospace; font-size: x-small;"><span style="white-space: pre-wrap;"><textarea cols="50" rows="15" name="code" class="c-sharp">var s = Application.GetResourceStream(new Uri("Assets/html/Help.txt", UriKind.Relative));
            if (s != null)
            {
                using (StreamReader reader = new StreamReader(s.Stream))
                {
                    wbHelp.NavigateToString(reader.ReadToEnd());
                }
            }
            else
            {
                wbHelp.NavigateToString("Help file not found");
            }</textarea> </span></span></p>
<p><span style="white-space: pre;"><br /></span></p>
<p><span style="white-space: pre;">其中本地文件help.txt的Build Action属性必须为"Content", 但是！但是！Uri开头<strong>不能</strong>使用反斜杠</span></p>
<pre><em>A relative URI that identifies the resource file to be loaded. The URI is relative to the application package and does not need a leading forward slas</em>h</pre>
<pre>from <a href="http://msdn.microsoft.com/en-us/library/ms596994(v=VS.95).aspx">msdn</a></pre>

            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6420095</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571679628981.html]]></link>
<title><![CDATA[Windows Phone - 使用Sterling数据库几个注意事项]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:10:06 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p><a href="http://sterling.codeplex.com/">Sterling</a>数据库是一个NoSQL 面向对象的数据库产品，不仅可用于Silverlight for Desktop而且可用于Windows Phone上。最近在一个Windows Phone项目上选择了Sterling作为数据库，主要原因有二：1.支持Linq查询 2.功能全面</p>

<p>使用Sterling进行数据存取操作，可参考其<a href="http://www.sterlingdatabase.com/sterling-user-guide">User Guide</a>, 在实际项目遇到了一些问题，几个注意事项如下：</p>

<p>1. 索引字段的值不能为null，否则保存时会遇到异常。这一点在User Guide中 <a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/b-indexes">Index</a>一节中没有提到，CodePlex上的disussion中提到了一个<a href="http://sterling.codeplex.com/discussions/240351">解决方法</a>：在Index定义时指定默认值。例如如下index_GroceryItem_Rating的定义</p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp"> protected override System.Collections.Generic.List&lt;ITableDefinition&gt; _RegisterTables()
        {
            return new List&lt;ITableDefinition&gt;
            {
                CreateTableDefinition&lt;Tombstone,bool&gt;(c=&gt;true),
                CreateTableDefinition&lt;Grocery,int&gt;(g=&gt; g.Id),
                CreateTableDefinition&lt;GroceryItem,int&gt;(x=&gt; x.Id).WithIndex&lt;GroceryItem,int,int&gt;(index_GroceryItem_GroceryId, x=&gt; x.GroceryId)
                                                                .WithIndex&lt;GroceryItem,string,int&gt;(index_GroceryItem_Rating, x=&gt; x.Rating?? string.Empty) //index cannot be null, so set default value if null
                                                                .WithIndex&lt;GroceryItem,int,int&gt;(index_GroceryItem_Quantity, x=&gt; x.Quantity)
                                                                
            };
        }</textarea>&nbsp;</p>

<p>2. Save之后使用Flush，以免程序异常终止后导致数据库主键及索引的破坏 参见 User Guide 之 <a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/c-saving-instances">Save</a></p>

<p>3. Auto Identity - 实现自增主键，需要实现一个<a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/g-triggers-and-interceptors">trigger</a></p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp"> public class GroceryTrigger : BaseSterlingTrigger&lt;Grocery, int&gt;
        {
            private int _nextId;
            public GroceryTrigger(int nextId)
            {
                _nextId = nextId;
            }
            public override bool BeforeSave(Grocery instance)
            {
                if (instance.Id &lt; 1)
                {
                    instance.Id = _nextId++;
                }
                return true;
            }
            public override void AfterSave(Grocery instance)
            {
                return;
            }
            public override bool BeforeDelete(int key)
            {
                return true;
            }
        }
</textarea>&nbsp;</p>

<p>并在程序启动或激活时(<span style="white-space: pre;">Application_Launching与</span><span style="white-space: pre;">Application_Activated事件中)</span>初始化</p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp"> private void ActivateEngine()
        {
            _engine = new SterlingEngine();
            _logger = new SterlingDefaultLogger(SterlingLogLevel.Information);
            _engine.Activate();
            _database = _engine.SterlingDatabase.RegisterDatabase&lt;GroceryDatabase&gt;();
            
            int maxGroceryListId =
                _database.Query&lt;Grocery, int&gt;().Any() ?
                (from id in _database.Query&lt;Grocery, int&gt;()
                 select id.Key).Max() + 1 : 1;
            _database.RegisterTrigger&lt;Grocery, int&gt;(new GroceryDatabase.GroceryTrigger(maxGroceryListId));
        }</textarea>&nbsp;</p>

<p>4.&nbsp;<span><a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/e-queries-and-filters">Caching<span lang="ZH-CN">的副作用</span></a></span><span lang="ZH-CN">。如果使用</span><span><a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/e-queries-and-filters">Query</a></span><span lang="ZH-CN">语句而不是</span><span><a href="http://www.sterlingdatabase.com/sterling-user-guide/4-databases/d-loading-instances">Load</a></span><span lang="ZH-CN">语句获得对象</span>，则获得对象是Cache的版本而不是数据库保存的版本，如果对Cache版本的修改还未通过Save操作提交，则Cache版本与数据库保存的版本是不一致的。不注意这一点可能会遇到一些意想不到的Bug。例如在一个page的view model使用如下Query语句加载了数据：</p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp">var items = (from item in App.Database.Query&lt;GroceryItem, int, int&gt;(GroceryDatabase.index_GroceryItem_GroceryId)
                         where item.Index == groceryId
                         select item).ToList();</textarea>&nbsp;</p>
<p>用户通过UI操作，修改了某些数据的值。page中有一个Save按钮和Cancel按钮，如果用户不想保存，选择取消，则对数据的修改没有提交。但是这时候Cache中的值已经改变。如果用户重新进入此page，再执行上面的Query语句，则得到的是Cache中的版本，这就与预期不符了。</p>

<p>解决方法是通过Load语句加载数据，保证每次加载的都是数据库中的版本：</p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp">var itemIds = (from x in App.Database.Query&lt;GroceryItem, int, int&gt;(GroceryDatabase.index_GroceryItem_GroceryId)
                         where x.Index == groceryId
                         select x.LazyValue.Value.Id).ToList();
            foreach (int id in itemIds)
            {
                var item = App.Database.Load&lt;GroceryItem&gt;(id);
                Items.Add(item);
                
            }</textarea>&nbsp;</p>


            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6574488</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571676406699.html]]></link>
<title><![CDATA[Windows Phone - 使用Sterling数据库实现墓碑化(Tombstone)]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:10:05 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>如果你的WP应用已经使用了<a href="http://blog.csdn.net/jameszhou/archive/2011/06/29/6574488.aspx">Sterling数据库</a>，那就顺便用Sterling实现墓碑化(Tombtsone)吧。Jeremy Likness的<a href="http://www.wintellect.com/CS/blogs/jlikness/archive/2011/02/14/windows-phone-7-tombstoning-with-mvvm-and-sterling.aspx">blog</a>详细说明了如何在MVVM架构中使用Sterling实现Tombstone。主要有几点：</p>

<p>1. 定义一个Tombstone数据类。其中用到了Sterling User Guide中提到的<a href="http://www.sterlingdatabase.com/sterling-user-guide/7-sterling-recipes">Singletone Serialization</a></p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp">public class TombstoneModel
{
    public TombstoneModel()
    {
        State = new Dictionary&lt;string, object&gt;();
    }
    public Dictionary&lt;string, object&gt; State { get; set; }
    public T TryGet&lt;T&gt;(string key, T defaultValue)
    {
        if (State.ContainsKey(key))
        {
            return (T)State[key];
        }
        return defaultValue;
    }
}</textarea>&nbsp;</p>
<p>2. 定义一个ITombstoneable接口。其中有Active与Deactive方法，分别于view的NavigatedTo方法，NavigatedFrom方法中调用。</p>
<p>在Deactive方法中保存Tombstone数据类到数据库，在Active方法中取出Tombstone数据， 用于恢复view model的状态。</p>

<p>3. 在需要Tombstone的view model上实现该接口</p>

<p>很多情况下，View Model需要View Loaded之后才可工作，Jeremy使用了一个匿名事件处理在Loaded之后执行Active方法。</p>
<p><textarea cols="50" rows="15" name="code" class="c-sharp">public static void ActivatePage(this PhoneApplicationPage phonePage, IViewModel viewModel)
{
    RoutedEventHandler loaded = null;
    loaded = (o, e) =&gt;
                    {                             
                        ((PhoneApplicationPage) o).Loaded -= loaded;
                        if (viewModel is ITombstoneFriendly)
                        {
                            ((ITombstoneFriendly) viewModel).Activate();
                        }
                    };
    phonePage.Loaded += loaded;
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    this.ActivatePage(GlobalManager.GetViewModel&lt;IMainViewModel&gt;());
    base.OnNavigatedTo(e);
}</textarea>&nbsp;</p>

<p>此外，Sterling目前还不支持IList的序列化，Active之后会发现该集合的项目均为null，<a href="http://sterling.codeplex.com/discussions/236484">讨论组</a>中提到了这个问题，可用List代替而解决。</p>

            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6574588</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571675031004.html]]></link>
<title><![CDATA[Windows Phone - 返回键]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:10:05 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>Windows Phone应用程序需要符合一些列的Guidelines，其中"返回键"是一个容易出问题的地方。</p>
<p><img src="/Upload/EditorImage/image/wp7/201205/6347215858253617300_1309321478KSS5.gif" alt="" /></p>

<p>&lt;&lt;UI Design and Intercation Guide for Windows Phone 7&gt;&gt; v2.0中这样描述：</p>


<p style="padding-left: 30px; ">The hardware Back Button is used to navigate back on pages (screens) within an application or between applications. The application allows the framework to perform the operation when the button is pressed. Also, the Back Button can be used to close menus, dialogs, navigate to a previous page, exit a search operation, or even switch applications. However, the principal usage is to navigate from the current page to the previous page.</p>
<p style="padding-left: 30px; ">See the Navigation, Frames, and Pages topic for more information about the page navigation model in Windows Phone 7.</p>
<p style="padding-left: 30px; ">When a user navigates back out of the root page of an application, the application will terminate.</p>
<p style="padding-left: 30px; ">The Back Button will not work as a backspace key to delete text input.</p>
<p style="padding-left: 30px; ">&nbsp;</p>
<p style="padding-left: 30px; ">&nbsp;</p>
<p style="padding-left: 30px; ">See the Navigation, Frames and Pages topic for additional guidance.</p>
<p style="padding-left: 30px; ">Developers should only implement Back Button behaviors that navigate back or dismiss context menus or modal dialog boxes. All other implementations are prohibited.</p>

<p>SDK 7.0/7.1 文档中的相关描述是：</p>

<p style="padding-left: 30px;">The hardware Back button is used to go back within an application or between 
applications. Also, the Back button can close an on-screen keyboard, menus, 
dialogs, navigate to a previous page, exit a search operation, or even switch 
applications. However, the principal usage is to move from a current screen to 
the previous screen.</p>

<p>总之，"返回键"只能用于返回上一页面。只是在有键盘、context菜单或弹出窗口时，这个返回操作是关闭键盘、取消context菜单或者弹出窗口。</p>

<p>如果页面中有弹出窗口，按"返回键"应取消弹出窗口，而不是退回到上一页面，Page类提供了可重载的OnBackKeyProcess方法，可供处理此逻辑：</p>

<p><textarea cols="50" rows="15" name="code" class="c-sharp">protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            if (popup.IsOpen)
            {
                popup.IsOpen = false;
                e.Cancel = true;
            }
                    
            base.OnBackKeyPress(e);
        }</textarea>&nbsp;</p>


<p>有些情况下需要提醒用户是否要退出当前页面(返回上一页面),例如提醒用户保存当前页。此时可重载OnBackKeyProcess方法如下：</p>

<p><textarea cols="50" rows="15" name="code" class="c-sharp">protected override void OnBackKeyPress(System.ComponentModel.CancelEventArgs e)
        {
            
            if (_isNewList)
            {
                if (!popupSavePromotion.IsOpen)//promotion not opened yet, show it
                {
                    e.Cancel = true;
                    popupSavePromotion.IsOpen = true;
                }
                else if (popupSavePromotion.IsOpen)//promotion already showed, if back key hit again, then close promotion and allow back key process continue
                {
                    popupSavePromotion.IsOpen = false;
                }
            }
           
            base.OnBackKeyPress(e);
        }</textarea>&nbsp;</p>

<p>用户第一次按下"返回键"时弹出提示窗口，此时，用户再次按下"返回键"时，返回上一页面。</p>



            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6574662</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571666474809.html]]></link>
<title><![CDATA[Windows Phone - 提交使用非官方支持语言的应用]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:10:04 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>客户有一个使用阿拉伯语言的应用，由于官方目前不支持阿拉伯语言，将NuetralLanguage属性设置为Arabic时提交返回说使用了未支持的语言。咨询了朋友，将该属性设置成目前支持的语言 如English(US)，可以提交成功。由于app description填写不符合规范，测试报告显示失败，信息如下：<img src="/Upload/EditorImage/image/wp7/201205/6347215857581928080_1318822050R2e2.gif" alt="" /></p><p><br /></p><p>根据以上测试报告，未通过的原因是违反了<a href="http://msdn.microsoft.com/en-us/library/hh184840(v=VS.92).aspx">5.5.1</a>这一条，应该用两种语言(提交的目标market的语言、应用中使用的文字语言)分别描述应用。而且要使用目标market语言说明该应用中使用的文字为第二种语言！不过这一点在5.5.1中对这种情况描述的并不清楚！</p><p>搜索了下marketplace中新浪的两个应用，sina news符合这一条，而weibo却不符合(没有中文描述信息) :-)<img src="/Upload/EditorImage/image/wp7/201205/6347215857847087040_1318822465tbTe.gif" alt="" /></p><p><img src="/Upload/EditorImage/image/wp7/201205/6347215858133875600_1318822481OS0l.gif" alt="" /><br /></p><p><br /></p><p><br /></p>
            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6880630</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571589052566.html]]></link>
<title><![CDATA[Tip: Windows Phone - 关于错误报告]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:09:56 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>TechEd2011上马宁提到了<a href="http://flurry.com">Flurry</a>可以用来做app的数据分析，在其wiki上搜索了很久没查到有关错误报告的api，找到一篇<a href="http://shinydevelopment.com/blog/find-errors-in-your-ios-app-before-your-users-do/">blog</a>提到了LogError api以及相关错误数据的报表。</p><p><a href="http://wiki.openxlive.com/Open-XLive-Features.ashx">OpenXLive</a>似乎还没有相关api</p><p><br /></p><p>有关错误处理微软的Andy，有一个很好的<a href="http://blogs.msdn.com/b/andypennell/archive/2010/11/01/error-reporting-on-windows-phone-7.aspx">实现-<span style="background-color: rgb(206, 213, 219); ">Little Watson</span></a>&nbsp;，另外<a href="http://bjorn.kuiper.nu/2011/10/02/wp7-littlewatson-extended-error-reporting-to-http-endpoint/">有人做了扩展</a>可将错误信息发送到你自己的http接口。</p>
            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/6881997</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/9/634721571588339564.html]]></link>
<title><![CDATA[Tip: Windows Phone - 匿名类型和 MethodAccessException]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Wed, 09 May 2012 11:09:56 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>一个wp7应用引用了<a href="https://github.com/facebook-csharp-sdk/facebook-csharp-sdk">Facebook csharp sdk</a>&nbsp;的dll, 传给FacebookClient的方法中使用了一个匿名类型，结果抛出MethodAccessException</p><p><pre style="font-family: Consolas; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; ">使用匿名类型:</pre><pre style="font-family: Consolas; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; ">fb.PostAsync(<span style="color:#a31515;">&quot;oauth/access_token&quot;</span>,<span style="color:blue;">new</span>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client_id&nbsp;=&nbsp;AppId,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;client_secret&nbsp;=&nbsp;AppSecret,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;redirect_uri&nbsp;=&nbsp;RedirectUri,
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;code&nbsp;=&nbsp;oauthResult.Code
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</pre>异常代码：</p><p><pre style="font-family: Consolas; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; ">&nbsp;<span style="color:blue;">foreach</span>&nbsp;(<span style="color:blue;">var</span>&nbsp;propertyInfo&nbsp;<span style="color:blue;">in</span>&nbsp;parameters.GetType().GetProperties())
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span style="color:blue;">if</span>&nbsp;(!propertyInfo.CanRead)&nbsp;<span style="color:blue;">continue</span>;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dictionary[propertyInfo.Name]&nbsp;=&nbsp;propertyInfo.GetValue(parameters,&nbsp;<span style="color:blue;">null</span>);
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</pre><br /></p><p>异常原因: 匿名类型被编译为internal成员，跨程序集访问时会遇到此异常。</p><p>解决办法：可在使用匿名类型的程序集AssemblyInfo.cs中使用如下特性：</p><p><pre style="font-family: Consolas; font-size: 13px; background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: white; background-position: initial initial; background-repeat: initial initial; "><span style="color:green;">//make&nbsp;anonymous&nbsp;type&nbsp;in&nbsp;this&nbsp;assembly&nbsp;can&nbsp;be&nbsp;accessible&nbsp;by&nbsp;Facebook.dll</span>
[<span style="color:blue;">assembly</span>:&nbsp;<span style="color:#2b91af;">InternalsVisibleTo</span>(<span style="color:#a31515;">&quot;Facebook&quot;</span>)]</pre><br /></p><p>参考:&nbsp;</p><p><a href="http://stackoverflow.com/questions/8273399/anonymous-types-and-get-accessors-on-wp7-1">http://stackoverflow.com/questions/8273399/anonymous-types-and-get-accessors-on-wp7-1</a></p><p><a href="http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx">http://msdn.microsoft.com/en-us/library/system.runtime.compilerservices.internalsvisibletoattribute.aspx</a><br /></p><p><br /></p>
            
                    <div>来源：http://blog.csdn.net/jameszhou/article/details/7247241</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720936405412739.html]]></link>
<title><![CDATA[Silverlight游戏研发手记：(九) 向Windows Phone移植之3D跨平台迁移]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 17:51:04 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">Silverlight 5</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">和Windows Phone 7.1都已具备SL.XNA模式，这意味着我们可以在相关平台上制作高性能的3D游戏及软件产品而无需二次编码。本节，我将借助一些工具的为大家讲解SL.XNA的3D实现原理，并演示如何加载并解析一个功能齐全带贴图和骨骼动画的角色模型。从今天开始，通向3D之大门正全方位为您开启！</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">关于传统3D游戏的原理并不是本文的重点，不再赘述。我们更迫切的需要了解XNA对哪些3D格式支持以便我们可以快速的开始配置开发环境。默认的，XNA开发游戏最常用到.X和.FBX；至于其他的3D文件格式呢？比如Obj、3ds、Md2等等。其实说到底，这与2D游戏中对精灵帧图的解析原理一样，无论什么类型的3D格式，其本质不过就一树形结构文本而已，只是内容较多且相对复杂些罢了；通过之前的教程学习，相信大家都已掌握了<a href="http://www.cnblogs.com/luckdv/articles/1728088.html?login=1" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">如何解析自定义的xml文件</a></span>，<a href="http://shiba.hpe.sh.cn/jiaoyanzu/WULI/showArticle.aspx?articleId=414&amp;classId=4" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; "><span style="font-size: 14pt; ">那么通过代码或事先编写好的工具对各类3D文件格式进行解析相信亦并非难事</span></a><span style="font-size: 14pt; ">，然后再将之与XNA的3D API对接，从而最终达到展示模型及运行骨骼动画等功能。不难看出，XNA游戏的核心也是最关键环节便是对资源的承载与解析，我们通常称之为内容管道 (ContentPipline)，该管道提供了相应接口可随意扩展，从而达到高度自由且全方位覆盖的目的。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">3D</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">比起2D来说水深得多，因此为了效率同时也为了降低入门成本，我们完全可以通过一些网上现有资源或开源项目来获取编写好的3D模型内容管道，在此和大家分享我的经验：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">1)<a href="http://creators.xna.com/en-us/sample/skinnedmodel" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Skinning Sample</a>&nbsp;–&nbsp;</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">官方提供的XNA入门级骨骼动画演示Demo(实用度<strong>★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209586789397230.png" width="711" height="380" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">这是微软官方为初学者提供的XNA解析.FBX格式骨骼动画之经典案例，从此，Dude这个名字变得家喻户晓。该源码的核心部分是以下两个类库：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209586885081261.png" width="231" height="260" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">然而实际情况并不乐观：我曾用它测试不下百个FBX带骨骼动画的模型，能够正确解析并正常显示的寥寥无几，尤其对骨骼数支持方面问题尤为严重。提示大家，仅作为示例学习学习便可，除非你有能力对该内容管道进行二次拓展，否则实用性极低。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">2)<a href="http://www.enchantedage.com/node/24" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">KiloWatt Animation</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209587050649652.jpg" width="400" height="236" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">这是一款开源的3D骨骼动画解析示例，支持XNA4.0，但目前版本不支持Windows Phone，同时亦测试过十多款.X骨骼动画模型，支持率不高。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">3)<a href="http://animationcomponents.codeplex.com/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Animation Component</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">一位韩国3D游戏大师开发的XNA骨骼动画解析开源组件，功能还蛮全的，而且也附带了比较详细的英文教程，暂时还不支持XNA4.0和Windows Phone。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">4)&nbsp;<a href="http://xnanimation.codeplex.com/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">XNAnimation</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">巴西人制作的开源的高性能3D骨骼动画支持演示，据作者说将发布XNA4.0版本，可以保持关注。<strong></strong></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">5)<a href="http://www.ziddu.com/download/16419668/FPSgameSample.rar.html" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">3D FPS Source</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">很难得的比较完整的XNA 3D射击游戏源码，包含的知识点元素很多，只可惜同样不支持XNA4.0和Windows Phone。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">6)&nbsp;<a href="http://axiom.codeplex.com/wikipage?title=Showcase&amp;referringTitle=Home" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Axiom</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209587679339563.png" width="625" height="381" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">作者介绍如下：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">Axiom Engine is an Open-source, cross-platform 3D rendering engine for .NET and Mono licensed using the LGPL. The engine is a high-performance C# port of the powerful OGRE engine and provides full support for DirectX, OpenGL and XNA on Windows, Linux, Android, iPhone and Windows Phone.</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">说实话，如果真的有作者所述之强大，其前途无可掂量；但至少来说，我暂时还未完全实验成功…</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">7)</span>&nbsp;<span style="font-size: 14pt; line-height: 28px; font-family: 宋体; "><a href="http://xnacommunity.codeplex.com/wikipage?title=WP7&amp;referringTitle=Home" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">XNA Community</a></span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">超多的XNA各平台游戏源码分享，称其为XNA入门级开发者的福音绝不为过。比如运行于WP7平台上的<a href="http://xnacommunity.codeplex.com/wikipage?title=JuegoIsoWP7&amp;referringTitle=WP7" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">劳拉RPG Demo</a></span>，<span style="font-size: 14pt; ">该源码对极复杂(各种资源混合压缩)的MD3(雷神之锤3)格式的骨骼动画解析近乎完美，运行效果非常流畅：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209588539068654.png" width="279" height="547" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">8)<a href="http://www.mono-project.com/Main_Page" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Mono</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209589451488495.png" width="901" height="488" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">不用多做介绍了吧，搞.NET若不知道真可以撞墙了。Write Once Play Everywhere是MONO的终极目标，也是XNA要实现全方位跨平台的主流方法。<a href="http://www.oschina.net/p/mono" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">然而，Mono却又并非微软官方所支持的解决方案</a></span>，<span style="font-size: 14pt; ">这确实是个令人纠结的技术难题。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">9)<a href="http://nine.codeplex.com/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Engine Nine</a>&nbsp;(</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">实用度<strong>★★★★★</strong>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209589653893276.png" width="639" height="503" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">一款跨微软所有游戏平台(Windows/Xbox 360/Windows Phone 7/Silverlight)的半开源3D项目源码(若在商业项目中用到它，请保留Engine Nice的标志，或者…这个你懂的)，其中不开源的部分是作者自己写的，封装成DLL供大家引用；开源部分则大多是收集整合而来，包含的游戏知识面比较很广的，总的来说至少可以搭建一套完整的XNA 3D RPG游戏。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">综合各种对比分析，并经过大量的反复测试，最终还是觉得Engine Nine来得给力。尤其是其拓展的素材管道Nine.Content.Pipeline.dll，对<a href="http://www.kwxport.org/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Kw X-port</a>导出的<a href="http://www.kwxport.org/" style="color: rgb(24, 72, 185); text-decoration: none; "></a>.X骨骼动画的支持效果极为出色。下面，我将就如何使用该引擎制作一款SL.XNA模式下的3D模型骨骼动画Demo做详细讲解。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">（一）导出骨骼动画模型.X文件</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">从2010版本开始，3D MAX便默认集成了对.FBX格式的导出功能；然而，若想要得到.X格式，我们还是得借助比如<a href="http://www.andytather.co.uk/Panda/directxmax_downloads.aspx" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Panda Directx Exporter</a>或<a href="http://www.kwxport.org/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Kw X-port</a>等插件才能实现。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">安装好相应插件后我们重启3D MAX，并打开事先准备好的带骨骼动画的角色模型：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209590000329047.png" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">这是一款国产MMORPG中非常标准的<a href="http://www.dogame.com.cn/bbs/viewthread.php?tid=14486" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">带全套动作的女侠模型</a></span>，<span style="font-size: 14pt; ">很适合作为本节Demo的主角。在导出该模型之前，我们需要特别注意此场景中所包含的全部对象并非只有女侠一个，还包括其手中握的剑；若我们直接点击导出，此时3D MAX会将场景中的所有对象一并导出，而这样得到的.X文件解析起来难度大且没什么意义，毕竟我们得考虑到游戏设计中的换装问题。因此，我们只需选中其中的人物部分，然后点击3D MAX的“导出”-&gt;“导出选定对象”即可：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209590255079218.png" width="664" height="588" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">至于应该选择何种文件类型，针对Engine Nine来说，经反复测试后发现还是Kw X-port导出的.X文件格式解析效果最好：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/6347209590314341459.png" width="520" height="261" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">最后也是最关键的环节 - 设置导出参数：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095904243346710.png" width="570" height="507" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">常用的导出配置如上图所示，其中我们可以通过右上角的Animation窗口，对该模型的骨骼动画各关键帧进行截取封装并重新命名。比如角色走路动作动画“Walk”，在3D MAX中可以通过调整下方的时间轴获悉角色走路动画的帧区间为65-105之间：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095906167154711.png" width="647" height="577" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">因此，对应导出参数便是Start = 65, Len = 40。至于其他动作动画导出也是以此类推。导出完毕后我们将得到1个.X文件和若干张贴图：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095906653027412.png" width="85" height="248" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">显而易见，该模型分为两部分贴图：头部和身体；这就意味着该模型在游戏中能实现3部分的换装：单手武器、头像和衣服。是否有种恍然大悟的感觉？没错，若想为游戏设计实现更为复杂的换装系统，比如衣服、裤子、头饰、护腕、手套、护膝，双手武器等等，则在建模的时候就必须和美术沟通清楚游戏角色方面的需求设定。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">（二）配置游戏项目整体环境</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">按照<a href="http://www.cnblogs.com/alamiye010/archive/2012/03/29/2423524.html" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">第六节</a></span><span style="font-size: 14pt; ">的方法创建一个新的SL.XNA游戏项目，然后在Content项目中将刚才导出的3个文件加载进去（置于Model文件夹下）：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095906850596813.png" width="227" height="121" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">是不是觉得这两张贴图文件的文件名不太好记？OK，我们双击Woman.X进入其神秘的内部，搜索一下“NP134_01.BMP”，发现它俩正好都处于文件的最尾部：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095907046548614.png" width="336" height="290" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">嘿嘿，至于如何处理不用我再多说了吧？</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">文件就位，剩下的便是解析，终于轮到Engine Nine上场了。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">我们首先为Content项目添加拓展的素材管道引用，位于Engine Nice/References/x86/Nine.Content.Pipeline.dll。之后，右键点击Woman.X-&gt;属性-&gt;设置内容处理器为“Model– Engine Nine”：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095907596566915.png" width="280" height="212" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">接下来，在游戏项目中添加对Engine Nine/References/Windows Phone/下的Nine.dll和Nice.Graphics.dll的引用：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095908228708016.png" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">至此，我们便完成了整体环境的配置工作。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">（三）加载并解析骨骼动画模型</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">万事俱备，终于可以大施拳脚。</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">1</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">）加载模型、网格及骨骼的方法代码：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); font-family: 'Courier New'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; color: rgb(35, 35, 35); "><img src="/Upload/EditorImage/image/wp7/201205/634720959087255477ContractedBlock.gif" class="code_img_closed" id="code_img_closed_aa4de737-03cd-490d-aa33-8ee670691787" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; vertical-align: middle; padding-right: 5px; " /><span class="cnblogs_code_collapse" style="border-right-color: rgb(128, 128, 128); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(128, 128, 128); border-top-width: 1px; border-top-style: solid; border-left-color: rgb(128, 128, 128); border-left-width: 1px; border-left-style: solid; border-bottom-color: rgb(128, 128, 128); border-bottom-width: 1px; border-bottom-style: solid; background-color: rgb(255, 255, 255); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; line-height: 1.5; ">加载武器和身体模型、骨骼动画</span></div><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; text-align: left; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095909522934917.jpg" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; text-align: left; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">2</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">）动态切换各部位贴图的方法代码(注意Meshes和MeshParts所对应的模型部位)：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); font-family: 'Courier New'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; color: rgb(35, 35, 35); "><img src="/Upload/EditorImage/image/wp7/201205/634720959087255477ContractedBlock.gif" class="code_img_closed" id="code_img_closed_5d2e05d8-b796-49b8-824e-ed51d2604b5a" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; vertical-align: middle; padding-right: 5px; " /><span class="cnblogs_code_collapse" style="border-right-color: rgb(128, 128, 128); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(128, 128, 128); border-top-width: 1px; border-top-style: solid; border-left-color: rgb(128, 128, 128); border-left-width: 1px; border-left-style: solid; border-bottom-color: rgb(128, 128, 128); border-bottom-width: 1px; border-bottom-style: solid; background-color: rgb(255, 255, 255); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; line-height: 1.5; ">脸部和身体切换贴图</span></div><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095910911416618.jpg" width="582" height="492" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">3</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">）播放单个骨骼动画的方法代码(可通过名称或序号播放相应骨骼动画)：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); font-family: 'Courier New'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; color: rgb(35, 35, 35); "><img src="/Upload/EditorImage/image/wp7/201205/634720959087255477ContractedBlock.gif" class="code_img_closed" id="code_img_closed_7be7f4b3-d826-48fd-b395-ebef7db02d8e" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; vertical-align: middle; padding-right: 5px; " /><span class="cnblogs_code_collapse" style="border-right-color: rgb(128, 128, 128); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(128, 128, 128); border-top-width: 1px; border-top-style: solid; border-left-color: rgb(128, 128, 128); border-left-width: 1px; border-left-style: solid; border-bottom-color: rgb(128, 128, 128); border-bottom-width: 1px; border-bottom-style: solid; background-color: rgb(255, 255, 255); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; line-height: 1.5; ">播放独立骨骼动画</span></div><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095911382008519.jpg" width="321" height="236" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">4</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">）播放组合骨骼动画的方法代码(这里面涉及的技巧很多，但Engine Nine很给力)：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); font-family: 'Courier New'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; color: rgb(35, 35, 35); "><img src="/Upload/EditorImage/image/wp7/201205/634720959087255477ContractedBlock.gif" class="code_img_closed" id="code_img_closed_dfd113cf-11ba-4545-b67c-422aa88d8453" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; vertical-align: middle; padding-right: 5px; " /><span class="cnblogs_code_collapse" style="border-right-color: rgb(128, 128, 128); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(128, 128, 128); border-top-width: 1px; border-top-style: solid; border-left-color: rgb(128, 128, 128); border-left-width: 1px; border-left-style: solid; border-bottom-color: rgb(128, 128, 128); border-bottom-width: 1px; border-bottom-style: solid; background-color: rgb(255, 255, 255); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; line-height: 1.5; ">播放组合动画</span></div><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095912174868420.png" width="325" height="267" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">5</span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">）绘制真实影子的方法代码(这是最简单的实现方案，但不是最好)：</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><div class="cnblogs_code" style="background-color: rgb(245, 245, 245); font-family: 'Courier New'; border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; border-top-style: solid; border-right-style: solid; border-bottom-style: solid; border-left-style: solid; border-top-color: rgb(204, 204, 204); border-right-color: rgb(204, 204, 204); border-bottom-color: rgb(204, 204, 204); border-left-color: rgb(204, 204, 204); border-image: initial; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; word-break: break-all; overflow-x: auto; overflow-y: auto; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; color: rgb(35, 35, 35); "><img src="/Upload/EditorImage/image/wp7/201205/634720959087255477ContractedBlock.gif" class="code_img_closed" id="code_img_closed_3af3af4c-83ed-4025-954e-fadb073ab8b0" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; vertical-align: middle; padding-right: 5px; " /><span class="cnblogs_code_collapse" style="border-right-color: rgb(128, 128, 128); border-right-width: 1px; border-right-style: solid; border-top-color: rgb(128, 128, 128); border-top-width: 1px; border-top-style: solid; border-left-color: rgb(128, 128, 128); border-left-width: 1px; border-left-style: solid; border-bottom-color: rgb(128, 128, 128); border-bottom-width: 1px; border-bottom-style: solid; background-color: rgb(255, 255, 255); padding-top: 2px; padding-right: 2px; padding-bottom: 2px; padding-left: 2px; line-height: 1.5; ">绘制模型蒙皮动画(包含影子)</span></div><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; ">&nbsp;</p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; text-align: left; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095914464880021.png" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; text-align: left; line-height: 21px; "><span style="font-size: 14pt; font-family: 宋体; ">&nbsp;最后还需要注意一点，关于如何将武器匹配到模型骨骼动画手的位置(以实现换武器效果)，代码中我们这样写：modelBatch.Draw(weapon, bodySkeleton.GetAbsoluteBoneTransform(&quot;Rfinger&quot;) * world, weaponEffect);其中“Rfinger”即对应该模型的右手指部件：</span><br /></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095917085980923.png" width="697" height="556" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " />&nbsp;</p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">&nbsp; &nbsp; 总体来说，Engine Nine封装了对.X文件相当完美的骨骼动画解析，就连动画之间的平滑过渡都做到精致到位(BoneAnimation的参数BlendDuration)，就目前来说，足以满足绝大多数手游或页游的3D游戏设计需求。</span></p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; text-align: left; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">以下是本节Demo源码下载地址：</span></p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; text-align: left; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; "><a href="http://files.cnblogs.com/alamiye010/(WP)SLXnaGame1.rar" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Windows Phone版本</a></span></p><p align="left" style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; text-indent: 28.5pt; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; text-align: left; line-height: 21px; "><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; "><a href="http://files.cnblogs.com/alamiye010/(SL)SLXnaGame1.rar" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Silverlight版本</a>(<a href="http://www.cangod.com/" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">在线演示</a>)</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 25px; "><span style="font-family:宋体;"><span style="font-size: 19px; line-height: 28px; "><img src="/Upload/EditorImage/image/wp7/201205/63472095918832401222.png" width="727" height="567" alt="" style="border-top-width: medium; border-right-width: medium; border-bottom-width: medium; border-left-width: medium; border-style: initial; border-color: inherit; border-image: initial; border-top-style: none; border-right-style: none; border-bottom-style: none; border-left-style: none; margin-left: 0px; " /><br /></span></span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><strong><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">手记小结：</span></strong><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">目前的Windows Phone 平台不支持自定义着色器(电池寿命问题？)，这意味着我们只能使用比如BasicEffect和SkinnedEffect等内置的Shader。而基于浏览器的Silverlight则只能在受信任开启显卡支持的条件下使用3D功能(基于客户端操作系统/显卡等环境因素影响考虑)。虽然依旧存诸多的不完善，但WP8和WIN8的强劲再一次让我满怀信心；好比本节通过3D MAX + Kw X-port + Engine Nine + SL.XNA构建的极具实用价值的高性能跨平台3D骨骼动画游戏案例，作为向3D进军的第一声号角，谁都无法阻挡我们勇往直前的脚步！</span></p><p style="margin-top: 5px; margin-right: auto; margin-bottom: 5px; margin-left: auto; color: rgb(35, 35, 35); font-family: Verdana, Arial, helvetica, sans-seriff; font-size: 14px; line-height: 21px; "><strong><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">推荐参考：</span></strong><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; "><a href="http://cnblogs.com/nowpaper" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Nowpaper</a></span><span style="font-size: 14pt; line-height: 28px; font-family: 宋体; ">和<a href="http://www.cnblogs.com/wangergo" target="_blank" style="color: rgb(24, 72, 185); text-decoration: none; ">Williams</a>关于Windows Phone的游戏开发博客。</span></p>
            
                    <div>来源：http://blog.csdn.net/alamiye010/article/details/7547155</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869927583857.html]]></link>
<title><![CDATA[【支持XP】传智播客WP7（Windows Phone 7）模拟器强力发布]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:33 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>&nbsp; 微软MIX11大会上微软发布的Mango的最新特性让关注移动的开发人激动不已：增加中文支持、多任务、直接操作设备（比如摄像头）API、Socket、支持SQLCE数据库、指南针API、陀螺仪API、访问日程安排的API、内置IE支持HTML5、XNA和Silverlight混合使用&hellip;&hellip;这些特性大大扩大了扩展应用的能力。<span style="color: #ff0000">有了中文支持华人终于可以舒服的用上WP7了，有了多任务闹钟程序不用再必须显示在前端了，开发人员可以直接读取摄像头这样实景增强类应用在Windows Phone上就能轻松实现了，有了Socket支持WP7版的QQ将会变为现实、有了SQLCE数据支持我们就不用再可怜的把数据往独立存储中存了。&nbsp;</span></p>
<p>&nbsp;&nbsp;&nbsp; 后发制人的微软就是牛，我十分看好Windows Phone的未来，详细参考我的博文<a href="http://www.cnblogs.com/rupeng/archive/2011/03/25/1994977.html" target="_blank"><font color="#0066cc">《向前向前向前！向Windows Phone平台前进》</font></a>。看了微软演示的WP7开发工具最新版中也对仿真器做了增强，比如收音机用网络收音机模拟、用3D旋转模拟手机旋转、用地图选取模拟手机位置变化。可以看到windows phone的开发原来越人性化、易用，这正是微软平台吸引开发人员的一个地方。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 眼睁睁的看着微软官方的仿真器的仿真设备越来越多，而且和我的&ldquo;传智播客.Net培训WP7模拟器&rdquo;中的实现非常相似，微软如果把仿真器做的再完善点，那我的&ldquo;传智播客.Net培训WP7模拟器&rdquo;优点就只剩下了&ldquo;能运行在Windows XP下&rdquo;这个最重要的优点了。为了能让更多人能提早接触Windows Phone开发，因此我今天把&ldquo;传智播客.Net培训WP7模拟器&rdquo;发布出来。&nbsp;</p>
<p><img src="/Upload/EditorImage/image/wp7/201205/6347208927150791002011041722515572.jpg" style="display: block; margin-left: auto; margin-right: auto" alt="" /></p>
<p>这款仿真器的优点如下：</p>
<p>&nbsp;<span style="color: #ff0000"> 1）可以运行在windows xp下</span></p>
<p><span style="color: #ff0000">&nbsp; 2）实现了WP7绝大部分API。包括启动器、选择器、外设（收音机、GPS、振动器、麦克风、摄像头、加速度感应器）、WP7特殊控件（枢轴视图、全景视图、DatePicker、TimePicker、ListPicker、ApplicationBar）、XNA部分功能（Audio、触摸屏、MediaLibrary、InputScope键盘处理）、墓碑机制（TombStone）等。</span></p>
<p>&nbsp; 3）不需要DirectX10支持，在低端显卡上也能运行</p>
<p>&nbsp; 4）资源占用小，不像WP7仿真器那样对计算机性能要求高，因此普通笔记本就能运行</p>
<p>&nbsp; 5）开发调试方便，能够把本机磁盘映射为手机的媒体库。</p>
<p>&nbsp; 6）模拟外设丰富，收音机用网络收音机模拟、用3D旋转模拟手机旋转、用地图选取模拟手机位置变化、振动器模拟器、加速度模拟器、用电脑摄像头模拟手机摄像头。</p>
<p>&nbsp;7）项目尽可能的模拟Windows Phone开发的所有特性，比如可以像WP7仿真器一样通过修改WMappManifest.xml来修改页面的启动页、Tile图片标题，可以像WP7仿真器一样通过SplashScreenImage.jpg来设置程序的SplashScreen。</p>
<p>下载地址：</p>
<p>1、博客园 下载地址：</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <a href="http://files.cnblogs.com/rupeng/ItcastWP7Simulator20110417.rar" target="_blank"><font color="#0066cc">http://files.cnblogs.com/rupeng/ItcastWP7Simulator20110417.rar</font></a></p>
<p>2、&nbsp;CSDN下载地址：</p>
<p><a href="http://download.csdn.net/source/3199405" target="_blank"><font color="#0066cc">http://download.csdn.net/source/3199405</font></a></p>
<p>3、Skydriver下载地址：</p>
<p><a href="http://cid-dc3fa2919b5f54bb.office.live.com/self.aspx/.Public/ItcastWP7Simulator20110417.rar" target="_blank"><font color="#0066cc">http://cid-dc3fa2919b5f54bb.office.live.com/self.aspx/.Public/ItcastWP7Simulator20110417.rar</font></a></p>

<p>环境要求：.Net Framework 4、Silverlight4_Tools.exe、Silverlight 4.0开发人员运行时（Silverlight4_Developer）；VisualStudio 2010。</p>
<p>操作系统：Windows XP、Windows Vista、Windows 7。</p>
<p>安装使用方法：</p>
<p>1、 将WP7SimulatorApp.zip放到我的文档文件夹的&ldquo;/Visual Studio 2010/Templates/ProjectTemplates&rdquo;下，将PhoneApplicationPage.zip放到我的文档文件夹的&ldquo;/Visual Studio 2010/Templates/ItemTemplates&rdquo;下。</p>
<p>2、请将Itcast.Net.Phone.InteropServices.zip包解压到硬盘上，然后运行reg.bat即可。注意运行完毕不要删除或者移动解压后的文件。</p>
<p>3、新建Windows Phone项目：打开VisualStudio2010，点击&ldquo;文件&rdquo;&rarr;&ldquo;新建&rdquo;&rarr;&ldquo;项目&rdquo;，选择左侧&ldquo;已安装模板&rdquo;中的&ldquo;VisualC#&rdquo;，在右侧项目列表中找到&ldquo;WP7SimulatorApp&rdquo;即可新建Windows Phone项目。模拟器必须以OutOfBrowser方式运行，由于VisualStudio的项目模板没法设置StartAction，所以需要手动设置OutOfBrowser方式启动（请对VSSDK熟悉的朋友帮忙解决这个问题）。请在新建的项目上点击右键，选择&ldquo;属性&rdquo;，在打开页面的&ldquo;Silverlight&rdquo;选项卡，先将&ldquo;允许在浏览器外运行应用程序&rdquo;前的复选框的勾选去掉，再将复选框重新选中即可。点击F5漂亮的Windows Phone 7模拟器就运行起来了。</p>
<p>4、 如果需要增加新的页面，只要在项目上点击右键，选择&ldquo;添加&rdquo;&rarr;&ldquo;新建项&rdquo;，选中左侧的&ldquo;VisualC#&rdquo; 在右侧项目列表中找到&ldquo;PhoneApplicationPage&rdquo;即可新建一个Windows Phone页面。</p>
<p>5、高级控件：安装Toolkit控件（Microsoft.Phone.Controls.Toolkit，微软提供的开源的WP7控件，默认没有包含在WP7中，需要单独下载安装），安装地图控件BingMaps Silverlight（Microsoft.Phone.Controls.Maps）</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &ldquo;传智播客.Net培训WP7模拟器&rdquo;尽可能真实模拟Windows Phone设备的开发和运行效果，但是由于个人能力有限，不能100%模拟Windows Phone设备，因为这是一款模拟器，而非仿真器，因此实现上并非100%等同于WP7设备，实际开发效果以Windows Phone真机设备的运行结果为准。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 这个模拟器冠名传智播客.Net培训，但是我个人的作品。这个模拟器使用了MIRIA、FluxJpeg等开源项目，很多代码从Silverlight For WP7、AppMakr中拷贝修改而成，这其中可能有侵权，但为了推广WP7，让更多人学习WP7开发，我就恬不知耻的侵权了，我愿意承担一切相关风险。感谢被我借鉴的产品，为了WP7的未来，恳求你们默许我的侵权。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 传智播客.net培训官方网站：<a href="http://net.itcast.cn/" target="_blank"><font color="#0066cc">http://net.itcast.cn</font></a>&nbsp; 我的微博：<a href="http://t.qq.com/yzk369" target="_blank"><font color="#0066cc">http://t.qq.com/yzk369</font></a>&nbsp; 收听我的微博关注最新版本更新</p>
            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6522096</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869921933566.html]]></link>
<title><![CDATA[首款WindowsPhone 7 PC端实时截图工具诞生攻坚实录（一） ]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:32 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            <p>这是首款WindowsPhone 7 PC端实时截图工具，能够实时显示Windows Phone真机中的界面！<br />演示GIF动画如下：</p>
<p><img style="display: block; margin-left: auto; margin-right: auto;" src="/Upload/EditorImage/image/wp7/201205/6347208927067519702011062023282476.gif" alt="" /><br /><strong>演示视频如下：</strong></p>
<p><a href="http://v.youku.com/v_show/id_XMjc3MjY0NDA0.html">http://v.youku.com/v_show/id_XMjc3MjY0NDA0.html</a></p>


<div>安装包下载：<a href="http://files.cnblogs.com/rupeng/ScrnMonitor20110620.zip"><span style="color: #0066cc;">http://files.cnblogs.com/rupeng/ScrnMonitor20110620.zip</span></a><br /><strong>安装方法：</strong></div>
<p>1、首先把手机连接到电脑上，并且启动Zune，将电脑和手机设置为Connected状态。<br />2、ItcastWPDevPC20110620.zip 是PC端程序，启动ItcastWPDev.exe，设置监听端口后点击【Start】启动监听。<br />3、WP7ScreenMonitorAgent.xap是手机端程序。安装后启动&ldquo;ScreenMonitor&rdquo;，设置服务器IP和端口后点击【Start】启动手机端监听即可。如果要退出程序进入Tile主页面或者进入别的程序，那么需要按Home键，也就是Windows徽标键来回到Tile主页面，不要按后退键退出程序，否则监听进程会退出。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下面开始正题，讲解这个工具的开发过程和心得体会。这么多年没熬过夜了，这次我连续四天熬夜到3点多终于搞出来了这款工具，遂写下战斗日记。PS：不要熬夜，真的伤身体。</p>
<p><br /><strong>一、有需求才能有产品</strong>&mdash;&mdash;&ldquo;学生说：要有是实时截图工具！所以就有了截图工具。&rdquo;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最近在备课传智播客.Net培训班的Windows Phone 7（WP7）的课程内容，虽然说通过模拟器基本能够让学生理解Windows Phone手机，不过如果能让学生看到真机那感觉还是不一样的。如何把Windows Phone真机的屏幕展示给讲台下的学生看就成了必须解决的问题，曾经想着用电脑摄像头照手机的屏幕，但是反光问题很难解决，而且手在操作触摸屏的时候就会遮挡屏幕，因此需要一款通过程序来截取真机屏幕显示到PC上的工具。</p>
<p><strong>二、解决后台截屏问题&mdash;&mdash;稳扎稳打</strong><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &ldquo;不要重复造轮子&rdquo;，我先到网上搜索是否有了类似的工具，网上的资料都是关于截取程序截图的，我想要一个也能截取手机中其他的程序界面的工具。最终找到一款牛人fiinix开发的<a href="http://forum.xda-developers.com/showthread.php?t=1006331"><span style="color: #0066cc;">&ldquo;CSharp DllImport&rdquo;</span></a>，这个工具中提供了后台截屏的功能，开启程序以后进入到要截屏的界面按下拍照键就可以将当前界面的截图保存到MediaLibrary中，就是它了！</p>
<p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 不要小看这款工具，熟悉Windows Phone的开发人员看到它绝对有&ldquo;它打开了通向Windows Phone未知领域的大门&rdquo;，为什么这么说呢？首先看&ldquo;后台&rdquo;功能，众所周知，在Mango之前WP7是不支持多任务的，因此一旦离开程序进入别的程序，那么当前的程序就会被结束掉了。&ldquo;CSharp DllImport&rdquo;使用的是网上流传的<a href="http://net.itcast.cn/ViewArticle-350.aspx"><span style="color: #0066cc;">《修改注册表让WP7支持多任务》</span></a>的方法来避免离开程序比较程序被结束的问题。&ldquo;CSharp DllImport&rdquo;中启动一个无限循环的后台线程，不断检测手机的按键状态，如果用户按下了拍照键，则会自动进行系统截屏。问题又来了，Windows Phone中只能对本程序的界面进行截图,是没有提供全屏截屏的功能，对Windows Mobile、Windows CE的朋友可能会说&ldquo;那调用GDI来截图不就行了吗？&rdquo;，不幸的是，Windows Phone中不支持PInvoke机制的，也就是无法编写调用GDI等win32 dll中的函数的代码，更不能调用自己用C/C++写的dll。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &ldquo;Windows Phone中不支持PInvoke机制&rdquo;这句话只是给你我这等菜鸟听的，牛人从来不相信。有牛人发现了《<a href="http://net.itcast.cn/ViewArticle-351.aspx"><span style="color: #0066cc;">在Windows Phone中调用win32 dll的方法</span></a>》，原理就是<span style="color: #ff0000;">微软的Microsoft.Phone.InteropServices.dll中的ComBridge类提供了RegisterComDll方法用来注册一个Com组件到WP7系统中，这样将Native代码写成一个Com组件，然后通过RegisterComDll注册到系统中即可。神奇的大门打开了！！！</span></p>
<p><span style="color: #ff0000;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone底层仍然是Windows CE，可以把Windows Phone看成Windows CE上运行的一个大软件</span>，就像当年的Windows 3.1是DOS上运行的一个软件一样，因此我们就可以用支持Windows CE开发的平台开发出Com组件，可以调用任何的Windows CE的SDK，然后放到Windows　Phone中去执行。</p>
<p><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用ComBridge调用VC编写的Dll的几个关键点，这块开发要涉及到Com组件的开发以及Interop的知识，这块知识不是这篇文章能覆盖的，因此如果您不熟悉Com这个.Net的老祖宗，那么可以不用看，也不影响你对于整体架构的理解。如果你需要熟练下面的每项技术，欢迎你来传智播客.Net培训班来学，我手把手的教你。<br /><br />1）在VC中创建一个Com项目。注意<span style="color: #ff0000;">如果要运行在HTC等Arm CPU的真机上时，需要构建ARM平台的二进制代码，如果要在Windows Phone7模拟器上运行的时候则需要构建为X86的平台，因为XDE是X86的CPU。</span><br />把Com组件生成的dll每次修改Com组件并且编译通过后都要拷到WindowsPhone项目中。为方便调试，建议将Com项目的输出路径指向Windows Phone项目，这样避免了把生成的dll拷来拷去的麻烦。</p>
<p>2）添加WMAppManifest.xml 到Windows Phone项目根目录下内容为：<br />&lt;?xml version="1.0" encoding="utf-8" ?&gt;<br />&lt;Interop&gt;<br />&lt;/Interop&gt;</p>
<p>3）修改Windows Phone项目的WMAppManifest.xml文件，在Capabilities节点下增加<br />&lt;Capability Name="ID_CAP_INTEROPSERVICES" /&gt;<br />也就是给程序INTEROP的能力。</p>
<p>4）在使用组件之前（比如程序启动的时候、类的Static初始化中）调用RegisterComDll方法用来注册Com组件<br />例子：ComBridge.RegisterComDll("Network.dll", new Guid("0111B877-9EE5-45ba-800E-CF324B5552C7"));<br />Network.dll 为Com组件的dll文件名，"0111B877-9EE5-45ba-800E-CF324B5552C7"为组件实现类的Guid。</p>
<p>5）在Windows Phone中声明对应的实现类和接口，使用ComImport标记类和接口，例如：<br />&nbsp;&nbsp;&nbsp; [ComImport, Guid("0111B877-9EE5-45ba-800E-CF324B5552C7"), <br />&nbsp;&nbsp;&nbsp; ClassInterface(ClassInterfaceType.None)]<br />&nbsp;&nbsp;&nbsp; internal class NetworkClass<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; [ComImport, Guid("25CC9D0F-CA11-4DED-8019-BC7C20CEE5D3"), <br />&nbsp;&nbsp;&nbsp; InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]<br />&nbsp;&nbsp;&nbsp; internal interface INetSockets<br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [PreserveSig]<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int HttpPost(string remoteServer, int remotePort, string path, IntPtr buffer, int len);<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; 然后INetSockets socks = new NetworkClass() as INetSockets;就可以拿到组件的实例然后调用Com组件中的方法了！<br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; <br />&nbsp;&nbsp;&nbsp; &ldquo;CSharp DllImport&rdquo;中使用的是CreateCompatibleDC、BitBlt等GDI方法来进行屏幕截取的，没什么特别的，不再详述。&nbsp;&nbsp;&nbsp; 现在已经有很多基于这个机制的WP7程序了，比如注册表编辑器RegistryEditor、TouchXPlorer、Yaaf.Wp7.AdvancedExplorer等。&ldquo;CSharp DllImport&rdquo;本身已经<strong>提供了大量的底层操作的API，包括获取电池状态、系统程序导航控制、获得系统按键状态、访问系统文件、访问注册表、直接拨号、操作粘贴板、进程控制</strong>等很多方法，感兴趣的直接打开CSharp - DllImport.dll的类结构就都明白了，不再详细的讲。注意使用这种方法调用Native代码是无法通过Marketplace审核的，所以这样的工具只能在越狱的机器上直接部署Xap的方式安装。</p>
<p><br />&nbsp;&nbsp;&nbsp; 现在Windows Phone还没有系统级别的中文输入法，我猜测<span style="color: #ff0000;">也许可以将Windows CE上的中文输入法通过这样的方法移植到Windows Phone上，这样可以解决Mango之前大家用不了输入法的问题</span>，有高人如果想做这项好事，我非常非常以及非常愿意提供帮助。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;后续讲解在后台程序中上传数据的方法以及一些程序优化手段。未完待续。。。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 欢迎收听我的腾讯微博，了解最新版本更新：<a href="http://t.qq.com/yzk369">http://t.qq.com/yzk369</a></p>

            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6557491</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869707091480.html]]></link>
<title><![CDATA[智能手机是个神马玩意：Windows Phone开发“文字+视频”教程（一）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:09 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<div id="cnblogs_post_body">
<p><strong>Windows Phone开发“文字&#43;视频”系列教程开篇：</strong></p>
<p>移动开发是未来的一个新的浪潮，对于.Net开发者来说现在开始学习Windows Phone开发技术是一个非常明智的选择。但是目前Windows Phone开发的资料非常少，特别是视频教程资料更少。</p>
<p>我把我在<a href="http://net.itcast.cn">传智播客.Net培训班</a>20110420班讲的Windows Phone课程现场视频录像整理出来放到放上分享。基于众所周知的原因，我不可能把全部现场Windows Phone课程都分享出来，分享的内容主要是Windows Phone开发的基础部分，网络记事本和LBS项目恕不能分享。但是只要掌握了Windows Phone开发的这部分基础，自己完全有能力把这些基础知识组合成一个项目。</p>
<p>如果只是单单的放视频教程也就失去了我写这系列博文的意义，因为如果光有视频教程而没有配套讲义的话学习效率是非常低的。因此我将利用后面的时间<strong>为每节教程配一篇博文，博文中不仅包含课堂上的关键性核心技术点、代码，也包含了我对这个技术点的理解</strong>。这套系列教程约分22节，由于为视频配文章也是需要时间的，我每周尽量至少公布三节。这22节主要内容为：智能手机概念、Windows Phone简介和演示、开发环境搭建、Task、外设（收音机、加速度感应器）、ApplicationBar、InputScope、独立存储、导航、墓碑机制、LBS应用概念及案例、地图控件BMSL（BingMaps
 Silverlight）。</p>
<p><strong>第一节 智能手机是个神马玩意</strong></p>
<p>视频教程在线观看：<a href="http://v.youku.com/v_show/id_XMjg3MjA4OTgw.html" target="_blank">http://v.youku.com/v_show/id_XMjg3MjA4OTgw.html</a>&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone是微软推出的新一代智能手机操作系统。智能手机是搭载了智能手机操作系统的手机，那么先要弄明白什么是“智能手机”呢？</p>
<p>有人说“智能手机就是很智能的手机”，可是那种“拥有它就同时拥有了数码照相机、数码摄像机、MP3、MP4、家庭影院，还能无线上网、畅聊QQ”的998山寨手机也很智能呀？也能手机网上、也能手机聊QQ，还能玩游戏，双卡双待、超长待机、压不坏、帅不随……多么智能呀，难道他们不是智能手机吗？</p>
<p style="text-align:center"><img alt="" src="/Upload/EditorImage/image/wp7/201205/6347208924926295372011072500162880.jpg"></p>
<p>有人说带操作系统的手机就是智能手机。但是比如诺基亚C3手机也搭载了S40操作系统，无数山寨手机使用的MTK架构就是使用Nucleus操作系统，那么为什么说他们不算智能手机？</p>
<p style="text-align:center"><img alt="" src="/Upload/EditorImage/image/wp7/201205/6347208924942931182011072500165325.jpg"></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 智能手机和非智能手机的区别用通俗的话说就是“能否由用户安装软件”，能由用户自己安装软件的手机就是智能手机，反之不能由用户自己安装软件的手机就是非智能手机。那些几百元的山寨手机虽然也能聊QQ、上网、玩游戏，但是它的那些程序都是出厂时就内置的，用户无法安装新的软件。比如拿到一款手机，上面有QQ、有浏览器，但是没有MSN，如果能从网上下载MSN软件并且装到手机上就是智能手机，如果不能装就不是智能手机。</p>
<p style="text-align:center"><img alt="" src="/Upload/EditorImage/image/wp7/201205/6347208924956963372011072500171360.jpg"></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;有人会说了“诺基亚的S40手机也能安装Java软件呀，为什么S40不是智能手机操作系统”，很多山寨手机、S40等手机系统都可以安装Jar、JAD的Java软件，但是这些Java软件一般都比较简单、功能有限，因此提到智能手机的时候一般都把这些只能安装Java程序的手机排除在外。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由于智能手机可以安装软件，大大扩展了手机的能力。现在智能手机上的软件五花八门，益智类的游戏有：植物大战僵尸、愤怒的小鸟、水果忍者；超炫的3D游戏有：极品飞车、街头篮球；有能屏蔽骚扰电话的手机安全卫士；还有能拍摄条形码自动显示商品比价的软件。想通过MSN和好友聊天就装一个手机版的MSN；想屏蔽响一声就挂、推销等电话就可以安装一个手机来电防火墙；每次都把名片手动录入手机很麻烦，因此就安装一个名片扫描软件自动识别名片；路痴就可以安装一个手机地图软件，到了陌生地方不用再问路……如果说非智能手机是能上网、聊QQ的手机，那么智能手机就是带短信、通话功能的随身电脑（随身智能终端）。</p>
<p>下篇预告：Windows Phone操作、使用演示。</p>
</div>

            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6630503</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869681058819.html]]></link>
<title><![CDATA[windows phone手机成功无线连接到笔记本]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:07 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<p align="center">&nbsp;</p>
<p>&nbsp;&nbsp;&nbsp; 以前我在传智播客.net培训班讲Windows Phone开发课程的时候，都是通过我开发的《WindowsPhone 7 PC端实时截图工具》工具来把Windows Phone手机界面操作展示给学生看的，手机端和PC端程序通过网络交换数据，由于把手机通过数据线连接到电脑上然后开启Zune就会自动把手机和PC建立成一个局域网，所以根本不用单独的配置。</p>
<p>&nbsp;&nbsp;&nbsp; 但是有两个理由让我想不通过数据线就在手机和PC之间通过无线网络连接，理由如下：<br>
1、Marketplace、Music &amp; Videos功能是无法在数据线连接状态下运行的，因此也就无法给学生演示这几个功能。<br>
2、我想演示一个Windows Phone远程遥控电脑播放电影的功能，如果连着数据线就体现不出“遥控”了。</p>
<p>&nbsp;&nbsp;&nbsp; 要做到这点想法很简单，就是让笔记本和Windows Phone手机之间建立无线连接，第一个想法是在我的笔记本电脑上启用AdHoc，让Windows Phone手机连接上来。但是不幸的是<span style="color:#ff0000">目前的Windows Phone只能连接AP，不能连接AdHoc</span>。<br>
&nbsp;&nbsp;&nbsp; 接着我在网上搜，有人说可以启用无线网卡的MyWifi功能让笔记本能够当无线AP，我的笔记本无线网卡也是文中描述的Intel 5100，但是经过试验发现MYWIFI功能在XP下不能用，必须在Vista、Win7下才能用。</p>
<p>&nbsp;&nbsp;&nbsp; 难道我只能把我家的无线路由器带到教室（教室没有能连接的无线热点），然后让我的笔记本电脑和Windows Phone手机连接到这个无线路由器上？好麻烦呢！<br>
突然记起来前两天我发的一篇微博“刚才想把手机中的一个文件拷到电脑中，但没有带数据线，想到手机可以创建一个WLan热点，也有手机版的飞鸽传书。因此我就把手机的WLan热点打开，然后我的笔记本连接手机的无线，然后两边都开飞鸽传书，哈哈，手机上的文件就可以轻松发到电脑上了。彻底摆脱数据线。移动互联，前途无限。（微博地址<a href="http://t.qq.com/p/t/69028079919734">http://t.qq.com/p/t/69028079919734</a> &nbsp;）”。思路打开了，<span style="color:#ff0000">我把我的Android手机上的“WLan热点”功能打开</span>（在程序列表中找到“WLan”项，Android
 2.2以后应该都有这个功能，按照说面创建Wifi热点），<span style="color:#ff0000">让我的Android手机当Wifi热点，然后我的笔记本电脑和Windows Phone手机都连接到我的“Android手机牌微型无线路由”上就ok了</span>！经过测试非常好用！</p>
<p>&nbsp;&nbsp;&nbsp; Windows Phone连接wifi的方法：Settings →Wifi，设置“Wifi Networks”为On状态，然后在下面的热点列表中找到相应的热点连接即可。</p>
<p><br>
&nbsp;&nbsp;&nbsp; 随身的微型无线路由器就是好用呀！以后在<a href="http://net.itcast.cn/" target="_blank">传智播客.net培训班Windows Phone开发培训</a>的课堂上就可以更好玩的演示Windows Phone了！</p>
<p>&nbsp;&nbsp;&nbsp; 有人会说“你这个没啥特别的，也没有通用性，你不就是用手机当成一个无线路由器用吗？我直接搞一个无线路由器不也一样吗？”，我只是在告诉大家一个我经历过的事情，“<strong>我只能说，事实就是这样，它确实发生了</strong>”，这里通过这个分享给大家一个思路，具体有什么用，各位就结合自己的实际情况灵活运用吧。收听我的微博：<a href="http://t.qq.com/yzk369">http://t.qq.com/yzk369</a>&nbsp;</p>
<p align="center"><img src="/Upload/EditorImage/image/wp7/201205/6347208924696091010_1312733033ryxL.gif" alt=""></p>

            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6667908</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869666167775.html]]></link>
<title><![CDATA[仙人指路：Windows Phone开发“文字+视频”教程（三）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:05 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
&nbsp;
<p>Windows Phone（WP7）演示第二部分</p>
<p>在线视频教程：</p>
<p><a href="http://v.youku.com/v_show/id_XMjg3MjMxNTQ0.html">http://v.youku.com/v_show/id_XMjg3MjMxNTQ0.html</a></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp; 在没有智能手机的时候，我们出行去一个陌生的地方必须首先电脑上网查好地图，而到了移动互联网时代就不用“临行细细查，意恐迷了路”了。智能手机中一个非常重要的应用就是地图，我们可以随时掏出手机知道我们在什么地方、周边有什么场所、去其他地方的路线等。这就是“移动互联网”和普通互联网的区别，移动互联网就是“移动着也能互联网”，不再受限于电脑、笔记本，可以随时随地享受互联网的应用。</p>
<p align="center"><img src="/Upload/EditorImage/image/wp7/201205/6347208924548435880_1312990482PGSZ.gif" alt=""></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone（WP7）中还内置了指南针，这样就再也不出现“找不到北的情况”。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 除了系统内置的软件，在Windows Phone中还可以安装大量的第三方软件，比如我在视频教程中就演示了在手机中编写C#代码的软件Pocket C#，这样<strong>在手机中就可以编写、测试C#代码</strong>；有可以用手机遥控电脑的Remote WP7，这样就可以<strong>躺在床上用手机遥控电脑上的电视剧前进后退</strong>；我还演示了一款在<strong>手机中远程桌面连接Windows 服务器</strong>的软件，在<a href="http://net.itcast.cn/" target="_blank">传智播客.Net培训班</a>课堂上给同学们演示这些程序的时候学生们都直呼“太神奇”了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 最后我小小得瑟了一把，因为我买的HTC Mozart手机是在低点1599元买的，抄底了，哈哈，现在据说已经涨了200多元了。</p>


            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6677371</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869663574619.html]]></link>
<title><![CDATA[WP7前途无限：Windows Phone开发“文字+视频”教程（四）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:05 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<p>&nbsp;视频教程在线观看：</p>
<p> </p>

<p>&nbsp; 相信很多人都已经听到了“谷歌达成摩托罗拉收购协议”这条消息&nbsp;，这条消息大家都可以看出谷歌发展移动互联网的决心。但是从另一个方面，也是对微软的一个好消息，<span style="color:#ff0000">三星、HTC等这些在多个手机系统之间徘徊的厂商必定“不再相信爱情”，毕竟摩托罗拉成了谷歌的亲生骨肉，其他使用Android系统的手机商场就无法和Moto站在同一条起跑线上了</span>，谷歌早就不想给这些厂商免费打工了，不要把谷歌想的多么高尚，它也是商业公司，也要为股东盈利。现在主流的三个手机系统：Android、Windows
 Phone、IOS，IOS是苹果御用的系统，其他厂家不用想碰，那么会有更多厂商选择倾向于Windows Phone系统，毕竟微软是打造“大伙有肉吃”的生态系统最好的公司。相信Windows Phone明天会更好。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2011年初我在51job上搜索Windows Phone（WP7）开发的职位还没有一条职位，而2011年6月份我搜索Windows Phone已经发现有300多个岗位了，我预测在2011年底至少会有1200个需求岗位，<span style="color:#ff0000">在2012年将会出现Windows Phone开发人员需求井喷（保守估计在4000个）</span>的情况，大戏即将上演敬请期待。</p>


<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PC机的普及成就了微软、Adobe、金山等一批软件企业，也成就了WinRAR、超级兔子、暴风影音等大大小小的软件公司，造就了比尔盖茨、张小龙、求伯君等无数的富翁。随着互联网时代的到来，谷歌、Twitter、FaceBook、腾讯、百度、新浪等无数的互联网企业成就霸业，短短几年就造就了卡扎伯&#26684;、马化腾等富豪，甚至名不见经传的一个地区网站的创始人也都身价百万。那么下一波财富浪潮是什么？当然是移动互联网了！！！所以要抓住移动开发的机会，成就自己的梦想，体现自己的人生价&#20540;！</p>
<p>　　</p>
<p><img src="/Upload/EditorImage/image/wp7/201205/6347208924496096920_1313425013nN3a.gif" alt=""></p>

<p>我通过JobUI看到的统计数据，<span style="color:#ff0000">windows phone的开发平均工资是：8934元</span>，想赚高薪的要抓住这个机会了！</p>
<p><img src="/Upload/EditorImage/image/wp7/201205/6347208924522836710_13134250457on9.gif" alt=""></p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 想趁机大捞一把的就来学Windows Phone开发吧。微软开发者社区是一个很有意思的群体，和Java社区比起来，微软技术的升级更新都是比较平缓的，微软都是在尽力保证技术的传承性和延续性，但是总有一些人在抱怨“微软技术怎么又更新了？刚学了***又出了***”、“***技术微软在推广，万一被淘汰了怎么办”、“微软倒闭了怎么办？”。关于这些奇怪的疑问我会在单独的文章中讨论，这里不再展开讨论。我只想说“移动开发是前途钱途无限的”这是一个真命题，Windows Phone是移动开发技术中的一种，微软成功了那么不用说，即使微软失败了（懂商业的人会明白这种概率太低了）我们也没有损失什么。不要以为学Windows
 Phone开发只是学那些类怎么用，学Windows Phone开发最重要的是学习移动开发的理念，比如触摸屏、加速度感应器、软键盘、GPS、LBS、PushNotification等这些东西，即使你搞Windows Phone失败了，到其他移动平台下难道就没有多点触摸、软键盘、GPS等等这些东西了吗？</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone的主要开发技术就是Silverlight、Windows Phone SDK、XNA。Windows phone 7开发大部分的内容都是Silverlight、XNA这些东西，真正WP7特有的技术并不多。如果不进行游戏开发，那么WP7开发只涉及到Silverlight和少量的WP7特有API了，而且Windows phone 7下的Silverlight和普通的Silverlight差别非常小，现在Silverlight资料非常多，所以这些Silverlight学习资料都相当于WP7的学习资料了。所以想学Windows
 phone 7又懒得装WP7开发环境的可以直接去学Silverlight就行。WP7特有API非常少，一两天时间就可以基本掌握，学习<a href="http://net.itcast.cn/">传智播客.Net培训班</a>的这套Windows Phone开发“文字&#43;视频”教程基本就能满足你的需要。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 对于移动应用来讲，很多时候数据、业务逻辑是放到云端的，比如本地数据的备份、公交换乘查询，这些都是需要云端来配合的，云端的开发仍然是ADO.Net、XML、JSon等这些技术，没有任何特殊的地方。</p>


            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6690291</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869657813041.html]]></link>
<title><![CDATA[支持XP的Windows Phone开发环境搭建：“文字+视频”教程（五）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:04 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
&nbsp;
<p>视频教程：</p>
<p> </p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 下面开始讲解Windows Phone开发环境的搭建，运行起来咱们第一个Windows Phone程序。下面讲三种Windows Phone开发环境的搭建方法：真机环境；微软Windows Phone仿真器；传智播客Windows Phone模拟器。</p>

<p><strong>（一）真机环境</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 开发Windows Phone程序最爽的环境就是使用真机进行开发，也就是拿着一个Windows Phone手机连到电脑上进行开发，真实的比虚机的爽得多的道理不用我说了。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 首先需要安装开发工具Windows Phone Developer Tools（Windows Phone的开发环境，是免费的，简称WPDT，7.0版本下载地址
<a href="http://download.microsoft.com/download/6/0/9/6092A6EA-8638-4F4B-BD49-4A8FF77B2E99/WPDT_RTM_en1.iso">
http://download.microsoft.com/download/6/0/9/6092A6EA-8638-4F4B-BD49-4A8FF77B2E99/</a>WPDT_RTM_en1.iso ，需要安装更高版本做法类&#20284;）。这款工具只能装在Windows 7上，如果在Windows XP下安装需要做修改，修改方法如下：</p>

<p>1）&nbsp; 把安装包解压</p>
<p>2）&nbsp; 使用记事本或其他文字编辑器打开<strong>baseline.dat</strong>，找到<strong>[gencomp7788]</strong>区段，把InstallOnLHS和InstallOnWinXP的&#20540;改为0。</p>
<p>3）&nbsp; 再运行setup.exe</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 接着需要一部Windows Phone手机，现在买Windows Phone水货只要一千多元。接着需要安装Zune这款软件（下载地址：<a href="http://www.zune.net/en-US/products/software/download/default.htm">http://www.zune.net/en-US/products/software/download/default.htm</a> &nbsp;），把Windows Phone手机通过数据线连接到电脑，直到Zune发现你的手机设备，然后点击Zune中的“Phone”标签进入手机同步状态（如下图）</p>
<p><img src="/Upload/EditorImage/image/wp7/201205/6347208924461291300_1313682507qTtR.gif" alt=""></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 由于开发过程中Windows Phone手机不能锁屏，因此请在手机上进入Settings→lock&#43;wallpaper，screen times out after，然后设置成never，这样就一直不会锁屏，当然开发结束最好还是设成自动锁屏，否则太费电。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 注意：开发过程中手机不能锁屏、必须保持和电脑的数据线连接、必须开启Zune。</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 接下来启动Microsoft Visual Studio 2010 Express for Windows Phone（开始→Microsoft Visual Studio 2010 Express下），然后点击主菜单File→New Project，在项目向导中选择Windows Phone Application，设置项目的名字和项目的路径，然后点击【OK】即可创建完成Windows Phone的项目。</p>
<p>&nbsp;&nbsp; 确保工具栏中选择“Windows Phone 7 Device”，也就是在真机设备中调试，然后点击绿色调试按钮即可在真机中启动运行了。</p>

<p><strong>（二）微软Windows Phone仿真器开发环境</strong></p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 如果你现在手头还没有Windows Phone真机，那么可以通过微软Windows Phone仿真器来体验一把，当然肯定没有真机爽。需要注意微软Windows Phone仿真器只能运行在Windows 7下，XP下是运行不了的（想在XP下体验的请看第三节“传智播客Windows Phone模拟器”）。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 只要安装开发工具Windows Phone Developer Tools（Windows Phone的开发环境，是免费的，简称WPDT，7.0版本下载地址
<a href="http://download.microsoft.com/download/6/0/9/6092A6EA-8638-4F4B-BD49-4A8FF77B2E99/WPDT_RTM_en1.iso">
http://download.microsoft.com/download/6/0/9/6092A6EA-8638-4F4B-BD49-4A8FF77B2E99/</a>WPDT_RTM_en1.iso ，需要安装更高版本做法类&#20284;）即可。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 接下来启动Microsoft Visual Studio 2010 Express for Windows Phone（开始→Microsoft Visual Studio 2010 Express下），然后点击主菜单File→New Project，在项目向导中选择Windows Phone Application，设置项目的名字和项目的路径，然后点击【OK】即可创建完成Windows Phone的项目。</p>
<p>确保工具栏中选择“Windows Phone 7 Emulator”，也就是在仿真器中调试，然后点击绿色调试按钮即可在仿真器中启动运行了。如果启动报错“Zune software is not launched. Retry after making sure that Zune software is launched”，说明你错选成了“Windows Phone 7 Device”。</p>

<p><strong>（三）能运行在Windows XP下的传智播客Windows Phone模拟器</strong></p>
<p>&nbsp;&nbsp;&nbsp; 很多朋友都由于这样那样的原因暂时只能工作在Windows XP下，他们本来是对Windows Phone开发感兴趣的，后来听说Windows phone 7微软Windows Phone仿真器必须在Windows7下就放弃了。而且微软的WP7的仿真器有很多缺点，比如很多设备无法用，比如FM收音机永远是off，加速度感应器永远是平躺静止状态，振动控制器看不到效果，摄像头模拟器永远都是一个随机动的黑色方块，麦克风无法用……；而且WP7的仿真器和主机交互麻烦，比如想把一首mp3放到仿真器中播放很难，想把仿真器中生成的一个文件拷出来也很难；WP7的仿真器对硬件要求高，配置差一点的电脑运行起来非常卡，卡的无法忍受。<br>
&nbsp;&nbsp;<br>
&nbsp;&nbsp;为了解决这个问题，技术、教学都牛&#36924;哄哄的.Net培训机构—传智播客开发出一个<a href="http://net.itcast.cn/ArticleList-5.aspx">“传智播客Windows Phone7的模拟器”</a>。这款模拟器有如下的优点：<br>
1）<strong>可以运行在windows xp下</strong></p>
<p>&nbsp;2）实现了WP7绝大部分API。包括启动器、选择器、外设（收音机、GPS、振动器、麦克风、摄像头、加速度感应器）、WP7特殊控件（枢轴视图、全景视图、DatePicker、TimePicker、ListPicker、ApplicationBar）、XNA部分功能（Audio、触摸屏、MediaLibrary、InputScope键盘处理）、墓碑机制（TombStone）等。</p>
<p>&nbsp; 3）资源占用小，不像WP7仿真器那样对计算机性能要求高，因此普通笔记本就能运行</p>
<p>&nbsp;4）开发调试方便，能够把本机磁盘映射为手机的媒体库。</p>
<p>&nbsp; 5）模拟外设丰富，收音机用网络收音机模拟、用3D旋转模拟手机旋转、用地图选取模拟手机位置变化、振动器模拟器、加速度模拟器、用电脑摄像头模拟手机摄像头。</p>
<p>&nbsp;6）项目尽可能的模拟Windows Phone开发的所有特性，比如可以像WP7仿真器一样通过修改WMappManifest.xml来修改页面的启动页、Tile图片标题，可以像WP7仿真器一样通过SplashScreenImage.jpg来设置程序的SplashScreen。</p>

<p>下载地址：</p>
<p>1、博客园 下载地址：&nbsp;<a href="http://files.cnblogs.com/rupeng/ItcastWP7Simulator20110417.rar">http://files.cnblogs.com/rupeng/ItcastWP7Simulator20110417.rar</a> &nbsp;&nbsp;</p>
<p>2、&nbsp;CSDN下载地址：<a href="http://download.csdn.net/source/3199405">http://download.csdn.net/source/3199405</a>
</p>
<p>3、高速网盘下载：<a href="http://dl.dbank.com/c00c7tu55n">http://dl.dbank.com/c00c7tu55n</a> &nbsp;</p>

<p>环境要求：.Net Framework 4、Silverlight4_Tools.exe、Silverlight 4.0开发人员运行时（Silverlight4_Developer）；VisualStudio 2010。</p>

<p>安装使用方法：</p>
<p>1、 将WP7SimulatorApp.zip放到我的文档文件夹的“\Visual Studio 2010\Templates\ProjectTemplates”下，将PhoneApplicationPage.zip放到我的文档文件夹的“\Visual Studio 2010\Templates\ItemTemplates”下。</p>
<p>2、请将Itcast.Net.Phone.InteropServices.zip包解压到硬盘上，然后运行reg.bat即可。注意运行完毕不要删除或者移动解压后的文件。</p>
<p>3、新建Windows Phone项目：打开VisualStudio2010，点击“文件”→“新建”→“项目”，选择左侧“已安装模板”中的“VisualC#”，在右侧项目列表中找到“WP7SimulatorApp”即可新建Windows Phone项目。模拟器必须以OutOfBrowser方式运行，由于VisualStudio的项目模板没法设置StartAction，所以需要手动设置OutOfBrowser方式启动（请对VSSDK熟悉的朋友帮忙解决这个问题）。请在新建的项目上点击右键，选择“属性”，在打开页面的“Silverlight”选项卡，先将“允许在浏览器外运行应用程序”前的复选框的勾选去掉，再将复选框重新选中即可。点击F5漂亮的Windows
 Phone 7模拟器就运行起来了。</p>
<p>4、 如果需要增加新的页面，只要在项目上点击右键，选择“添加”→“新建项”，选中左侧的“VisualC#” 在右侧项目列表中找到“PhoneApplicationPage”即可新建一个Windows Phone页面。</p>


            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6700002</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869634524815.html]]></link>
<title><![CDATA[项目配置和简单的Task：Windows Phone“文字+视频”教程（五）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:02 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
&nbsp;
<p>六、WMAppManifest配置</p>

<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Properties文件夹下的WMAppManifest.xml是对项目的一些基本配置，包括启动页面、程序标题、图标等。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; App的Title属性配置应用在程序列表中显示的名称，IconPath配置应用在程序列表中显示的图标（要在项目中把图标文件的“生成操作BuildAction”设置为“内容Content”）。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DefaultTask属性设置应用的启动页面（Name必须是_default）</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 项目中的SplashScreenImage.jpg是应用的启动画面，当应用启动的时候这张图片会显示，直到加载完毕。图片的文件名是固定的， “生成操作”设置为“内容”。可以把这张图片修改为个性化的产品信息。</p>

<p>七、Windows Phone开发之普通Task</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone中进行发送短信、发送邮件、打开网页等操作的时候都要通过Task来进行，不同的任务就是不同的Task类。所有Task类都有Show方法，调用Show方法启动任务，任务执行完毕一般会返回应用。</p>
<p>WP7基于安全考虑，几乎所有任务都不是自动启动，而是需要用户手动点击启动进行。比如发送短信的SmsComposeTask启动起来后需要用户点击发送按钮才能发送出去，这样可以防止泄密、吸费等问题。由于没有直接开放发送短信、拨打电话的API，所以就完全可以避免偷偷发送吸费短信、拨打吸费电话的病毒，因此Windows Phone平台下杀毒软件也有没有了意义。</p>
<p>常用Task有：</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SmsComposeTask：启动发送短信的任务，可以通过To、Body两个属性设置对方号码和短信内容。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EmailComposeTask：发邮件的任务，可以通过Subject 、 Body 、To 、 Cc属性设置标题、内容、收件人、抄送人。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; WebBrowserTask：打开网页的任务，可以通过URL属性设置要打开网页的地址。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PhoneCallTask：拨打电话的任务，可以通过PhoneNumber、DisplayName属性设置拨打的号码和显示的名称。</p>

            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6720230</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/8/634720869634312836.html]]></link>
<title><![CDATA[复杂的Task：Windows Phone开发“文字+视频”教程（七）]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Tue, 08 May 2012 15:54:02 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<p>点击查看&nbsp;在线<a href="http://net.itcast.cn/">Windows Phone 开发视频教程</a></p>

<p>&nbsp;&nbsp;&nbsp; 有一些需要得到执行结果的任务，比如从通讯录中选择一个手机号码，这些任务一般都从ChooserBase继承，监听Completed事件，从e中可以获得执行结果，所有e任务都有属性TaskResult表示执行结果（OK执行成功；Cancel任务被取消，比如启动拍照任务以后又取消了拍照），Error表示执行过程中的异常信息。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 在Completed事件处理函数中要检测e.TaskResult看用户是否取消了任务，并且检查e.Error检查执行过程中是否发生了异常，否则程序容易进入错误的状态。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; SavePhoneNumberTask：从联系人（People）中选择一个手机号码的任务。PhoneNumber属性为要保存的电话号码。</p>
<p>l&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PhoneNumberChooserTask：选择电话号码，e. PhoneNumber为选择的电话号码。</p>

<p>拍照的Task，可以用来启动拍照：CameraCaptureTask启动拍照任务，e. ChosenPhoto为拍照的图片流。</p>
<p>下面的例子是启动拍照任务，然后把拍照的图片显示到image1控件上：</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CameraCaptureTask cct = new CameraCaptureTask();</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cct.Completed &#43;= new EventHandler&lt;PhotoResult&gt;(cct_Completed);</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; cct.Show();</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void cct_Completed(object sender, PhotoResult e)</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; if(e.Error!=null||e.TaskResult!= TaskResult.OK)</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp; {return;}</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BitmapImage bitmap = new BitmapImage();</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; bitmap.SetSource(e.ChosenPhoto);</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; image1.Source = bitmap;</p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</p>
<p>&nbsp;&nbsp; </p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 使用CameraCaptureTask进行开发拍照的话，如果有真机最简单；如果使用微软的Windows Phone仿真器就相当不爽了，因为微软的Windows Phone仿真器的摄像头中只有一个随机变化的方块，用来测试完全没感觉。因此在传智播客的Windows Phone模拟器中，把电脑的摄像头映射为了手机的摄像头。如果你的电脑连摄像头也没有，那么也没关系，在进入拍照页面的时候你可以把一个图片文件或者一段wmv视频拖到手机模拟器上，那么就可以把这张图片或者这段视频做为模拟摄像头使用，非常方便好用。</p>
<p>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone中有媒体库（MediaLibrary）的概念，微软把手机中的图片、音乐等通过MediaLibrary进行统一管理。如果使用真机，可以使用Zune把电脑中的图片、音乐同步到手机中；如果使用微软的Windows Phone仿真器，那么很悲剧，你只能使用仿真机中内置的那几张图片和几段音乐；而如果你使用传智播客的Windows Phone模拟器，那么这块模拟器把电脑的“我的文档”中的“图片收藏”和“我的音乐”两个文件夹分别映射为媒体库的图片和音乐，使用起来非常方便。</p>
<p>在开发手机应用的时候会有把手机中的图片选择的需求，比如开发一个微博手机客户端，就会有把本地图片选择并且发表大微博上的需求。可以使用PhotoChooserTask来从媒体库中选择一张图片，和CameraCaptureTask使用非常类&#20284;，e. ChosenPhoto为拍照的图片流。</p>
<p>PhotoChooserTask还有一些额外的属性：PixelHeight、PixelWidth属性为要选择图片的尺寸，如果设置了这两个属性则会提供图片截取的功能，拍照完成后会显示截取界面，只截取指定的大小；ShowCamera属性设定是否允许用户拍照，也就是用户即可以从媒体库中选择图片，也可以直接通过摄像头拍照做为选择结果。</p>
<p>收听我的微博，了解最新windows phone技术。</p>
<p>腾讯微博地址：<a href="http://t.qq.com/yzk369">http://t.qq.com/yzk369</a> </p>
<p>新浪微博地址：<a href="http://weibo.com/1654727873">http://weibo.com/1654727873</a></p>


            
                    <div>来源：http://blog.csdn.net/cownew/article/details/6824639</div>]]></description>
</item>

<item>
<link><![CDATA[http://www.itivy.com/wp7/archive/2012/5/4/634717451512564992.html]]></link>
<title><![CDATA[Windows Phone开发环境搭建]]></title>
<author><![CDATA[wp7_developer]]></author>
<category><![CDATA[]]></category>
<pubDate>Fri, 04 May 2012 16:21:41 GMT</pubDate>
<guid><![CDATA[]]></guid>
<description><![CDATA[
            
<p><span style="font-size:16px"><span style="font-size:24px"><strong>一、Windows Phone系统介绍<br>
</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Windows Phone是微软发布的一款手机操作系统，它将微软旗下的Xbox Live游戏、Zune音乐与独特的视频体验整合至手机中。2010年10月11日晚上9点30分，微软公司正式发布了智能手机操作系统Windows Phone，同时将谷歌的Android和苹果的IOS列为主要竞争对手。2011年2月，诺基亚与微软达成全球战略同盟并深度合作共同研发，建立庞大的生态系统。<br>
<span style="font-size:24px"></span></span></p>
<p><span style="font-size:16px"><span style="font-size:24px"><strong>二、Windows Phone市场前景<br>
</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 目前的手机操作系统市场上，谷歌的Android系统和苹果的IOS已经占有绝对的统治地位。很多开发者已经加入到Android开发和IOS开发的浪潮中来。相信随着诺基亚与微软的合作深入，市场上基于Windows Phone操作系统的手机也将越来越多，这对于开发者来说，也算多了一种选择。尽管Windows Phone的未来还不得而知，但是可以看出，Windows Phone绝对是手机操作系统市场上的搅局者。一些开发者也开始了解并且学习Windows Phone的开发技术了。<br>
<span style="font-size:24px"></span></span></p>
<p><span style="font-size:16px"><span style="font-size:24px"><strong>三、Windows Phone开发环境搭建<br>
</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;学习一门新的技术，光读书是不够的，需要更多的实践。想要实践，就必须先搭建出开发环境。下面将介绍如何搭建Windows Phone开发环境。</span></p>
<span style="font-size:16px"></span>
<p><br>
<span style="font-size:18px"><strong>1. 使用模拟器开发<br>
</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果没有真机，就不得不用到模拟器进行开发。而目前微软的Windows Phone模拟器只能在Windows 7或者Windows Vista（Service Pack 2）系统下运行，所以我们首先需要保证我们的系统是Windows 7或者Windows Vista。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首先需要安装开发工具Windows Phone Developer Tools。这个就是Windows Phone的开发环境，是免费的，目前最新的版本是7.1，下载地址：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://www.microsoft.com/downloads/zh-cn/details.aspx?familyid=0a373422-6680-46a7-89e1-e9a468a14259<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下载vm_web2.exe 文件后安装，就会开始在您的计算机中安装 Windows Phone SDK 7.1 并安装必要的组件。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果需要以ISO文件的方式安装，可以从以下的地址直接下载：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://go.microsoft.com/fwlink/?LinkID=226694<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装具体过程不再赘述。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装成功以后，在运行菜单中运行Microsoft Visual Studio 2010 Express for Windows Phone即可打开开发环境。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;然后就可以开发Windows Phone程序并且部署到模拟器中运行了。</p>
<p><br>
<span style="font-size:18px"><strong>2. 使用真机开发<br>
</strong></span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;如果手头有真机的话，特别是已经越狱过的真机，开发Windows Phone程序的环境，就不限于Windows 7或者Windows Vista系统了，我们也可以在Windows XP上进行开发。这是因为，虽然微软的Windows Phone模拟器不能在Windows XP上运行，但是我们有真机可以进行运行和调试。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;首先也要下载Windows Phone Developer Tools，不过请先下载ISO文件。下载完成后：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;1） 把安装包解压。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;2）使用记事本或其他文字编辑器打开baseline.dat，找到[gencomp7788]区段，把InstallOnLHS和InstallOnWinXP的&#20540;改为0。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;3）再运行setup.exe开始安装。<br>
安装具体过程不再赘述。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装成功以后，在运行菜单中运行Microsoft Visual Studio 2010 Express for Windows Phone即可打开开发环境。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;为了能够在手机上调试，还需要下载Zune。下载地址：<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;http://www.zune.net/en-US/products/software/download/default.htm<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;下载和安装过程不再赘述。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;安装好Zune以后，当把Windows Phone手机通过数据线连接到电脑， Zune就会自动启动，发现你的手机设备。然后再Microsoft Visual Studio 2010 Express for Windows Phone开发环境中就可以部署程序到手机设备了。<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;需要注意的是，在开发过程中，手机不能锁屏，必须保持和电脑的数据线连接，必须开启Zune，否则无法部署成功。<br>
<br>
</p>
<p style="line-height:18.75pt; margin:0cm 0cm 0pt; background:white"><span lang="EN-US" style="font-size:10.5pt">---------------------------------------------------------------------------</span></p>
<p style="line-height:18.75pt; margin:0cm 0cm 0pt; background:white"><strong><span lang="EN-US" style="font-family:宋体; border-bottom:windowtext 1pt; border-left:windowtext 1pt; padding-bottom:0cm; padding-left:0cm; padding-right:0cm; font-size:10.5pt; border-top:windowtext 1pt; border-right:windowtext 1pt; padding-top:0cm">GL</span><span style="font-family:宋体; border-bottom:windowtext 1pt; border-left:windowtext 1pt; padding-bottom:0cm; padding-left:0cm; padding-right:0cm; font-size:10.5pt; border-top:windowtext 1pt; border-right:windowtext 1pt; padding-top:0cm">（<span lang="EN-US">arui319</span>）</span></strong><span lang="EN-US" style="font-size:10.5pt"></span></p>
<p style="line-height:18.75pt; margin:0cm 0cm 0pt; background:white"><strong><span lang="EN-US" style="font-family:宋体; border-bottom:windowtext 1pt; border-left:windowtext 1pt; padding-bottom:0cm; padding-left:0cm; padding-right:0cm; font-size:10.5pt; border-top:windowtext 1pt; border-right:windowtext 1pt; padding-top:0cm">http://blog.csdn.net/arui319</span></strong><span lang="EN-US" style="font-size:10.5pt"></span></p>
<p style="line-height:18.75pt; margin:0cm 0cm 0pt; background:white"><strong><span lang="EN-US" style="font-family:宋体; border-bottom:windowtext 1pt; border-left:windowtext 1pt; padding-bottom:0cm; padding-left:0cm; padding-right:0cm; font-size:10.5pt; border-top:windowtext 1pt; border-right:windowtext 1pt; padding-top:0cm">&lt;</span><span style="font-family:宋体; border-bottom:windowtext 1pt; border-left:windowtext 1pt; padding-bottom:0cm; padding-left:0cm; padding-right:0cm; font-size:10.5pt; border-top:windowtext 1pt; border-right:windowtext 1pt; padding-top:0cm">本文可以转载，但是请保留以上作者信息。谢谢。<span lang="EN-US">&gt;</span></span></strong><span lang="EN-US" style="font-size:10.5pt"></span></p>
<p style="line-height:18.75pt; margin:0cm 0cm 0pt; background:white"><span lang="EN-US" style="font-size:10.5pt">---------------------------------------------------------------------------</span></p>
<br>

            
                    <div>来源：http://blog.csdn.net/arui319/article/details/7383027</div>]]></description>
</item>


</channel>
</rss>

