9步搞定Win8 MetroUI应用移植

小黄鸭和大树 2012-06-14 10:44:50
加精
Win8 Metro UI应用的开发是一件非常有趣的事情,特别是它使用了非常奇特的Metro UI设计。如果现有传统UI设计的应用,能够很方便的移植到Win8上,并且也能够充分利用Metro UI的魔力,那么将是非常有有意义的事情。本篇博客就是讲述,在一般情况下,如何将传统UI应用移植成Metro UI应用。

移植工作看上去比较的难,但是按照规律办事,很多事情仅仅是时间和耐心问题。网友不妨使用9步法来完成你的应用移植:

1.
下载并安装Windows 8 Consumer Preview,下载并安装Microsoft Visual Studio 11 Express Beta。

2.
使用Microsoft Visual Studio 11 Express Beta 创建Metro UI应用程序项目,语言可以选择你自己喜欢的C/C++、C#或者Visual Basic等。

3.
将你要重复使用的文件夹、源代码、资源文件等拷贝到你的新项目中,并且在Solution Explorer中选择Show All Filters。

4.
用鼠标右键选择你的文件夹、文件等,将其添加入新项目中。

5.
使用整个项目的查找替换方法,将System.Windows替换成为Windows.UI.Xaml。

Silverlight XAML namespaces
Windows Runtime XAML namespaces

System.Windows
Windows.UI.Xaml

System.Windows.Automation
Windows.UI.Xaml.Automation

System.Windows.Automation.Peers
Windows.UI.Xaml.Automation.Peers

System.Windows.Automation.Provider
Windows.UI.Xaml.Automation.Provider

System.Windows.Automation.Text
Windows.UI.Xaml.Automation.Text

System.Windows.Controls
Windows.UI.Xaml.Controls

System.Windows.Controls.Primitives
Windows.UI.Xaml.Controls.Primitives

System.Windows.Data
Windows.UI.Xaml.Data

System.Windows.Documents
Windows.UI.Xaml.Documents

System.Windows.Input
Windows.UI.Xaml.Input

System.Windows.Interop
Windows.UI.Xaml.Interop

System.Windows.Markup
Windows.UI.Xaml.Markup

System.Windows.Media
Windows.UI.Xaml.Media

System.Windows.Media.Animation
Windows.UI.Xaml.Media.Animation

System.Windows.Media.Imaging
Windows.UI.Xaml.Media.Imaging

System.Windows.Media.Media3D
Windows.UI.Xaml.Media.Media3D

System.Windows.Navigation
Windows.UI.Xaml.Navigation

System.Windows.Printing
Windows.UI.Xaml.Printing

System.Windows.Resources
Windows.UI.Xaml.Resources

System.Windows.Shapes
Windows.UI.Xaml.Shapes




6.
拷贝能够重复使用的XAML代码到项目的XAML文件中去(你可以根据需要创建新的XAML文件)。

7.
编译你的项目,使用错误信息快速定位需要修改的地方。使用Windows Runtime APIs替换元代的.NET APIs。

8.
对不能够简替换的代码部分,使用注释将其暂时屏蔽,以便日后慢慢修改。重复7和8的方法直到整个项目完全编译通过。

9.
对暂时屏蔽的代码部分逐一解决。完成所有相关的修改后,你的移植工作基本完成,下面的工作就是解bugs了。



怎么样?是不是比较简单!还不现在动手试一试J。

原文地址:http://g.csdn.net/5220269
...全文
1154 38 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
38 条回复
切换为时间正序
请发表友善的回复…
发表回复
hg2980986 2012-06-28
  • 打赏
  • 举报
回复
LAONINGA098 2012-06-28
  • 打赏
  • 举报
回复
多谢分享
yywfsky 2012-06-27
  • 打赏
  • 举报
回复
这样移植过去的效率高不高呢?
骑驴到上树 2012-06-22
  • 打赏
  • 举报
回复
good ~ studying
noa988 2012-06-22
  • 打赏
  • 举报
回复
很好 支持 http://gd-hh.com
whisper0429 2012-06-21
  • 打赏
  • 举报
回复
学习能得分不
doubleL001 2012-06-21
  • 打赏
  • 举报
回复
受益匪浅。。。
zzeng12 2012-06-20
  • 打赏
  • 举报
回复
好好学习下 才入门~~
weifubin 2012-06-19
  • 打赏
  • 举报
回复
这是什么对什么,表示看不懂!
ran22dom 2012-06-18
  • 打赏
  • 举报
回复
学习了。。谢谢楼主
xiying12571 2012-06-18
  • 打赏
  • 举报
回复
谢谢分享,楼主好热闹
cdg30588 2012-06-17
  • 打赏
  • 举报
回复
学习了 谢谢楼主分享
lfgqce 2012-06-17
  • 打赏
  • 举报
回复
支持+学习
smartwmx 2012-06-16
  • 打赏
  • 举报
回复
win8 什么时候可以买到
sprbell 2012-06-14
  • 打赏
  • 举报
回复
谢谢分享,楼主好热闹
payne1007 2012-06-14
  • 打赏
  • 举报
回复
多谢分享
a65596859 2012-06-14
  • 打赏
  • 举报
回复
神 贴
q107770540 2012-06-14
  • 打赏
  • 举报
回复
这不就是把前几天CSDN首页推荐的文章给转过来了么
zqkcxx 2012-06-14
  • 打赏
  • 举报
回复
太前卫了。学习中
a395885670 2012-06-14
  • 打赏
  • 举报
回复
学习了 谢谢楼主分享
加载更多回复(6)

567

社区成员

发帖
与我相关
我的任务
社区描述
英特尔® 边缘计算,聚焦于边缘计算、AI、IoT等领域,为开发者提供丰富的开发资源、创新技术、解决方案与行业活动。
社区管理员
  • 英特尔技术社区
  • shere_lin
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧