9步搞定Windows8 MetroUI应用移植

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

 

  1. 拷贝能够重复使用的XAML代码到项目的XAML文件中去(你可以根据需要创建新的XAML文件)。
  2. 编译你的项目,使用错误信息快速定位需要修改的地方。使用Windows Runtime APIs替换元代的.NET APIs。
  3. 对不能够简替换的代码部分,使用注释将其暂时屏蔽,以便日后慢慢修改。重复7和8的方法直到整个项目完全编译通过。
  4. 对暂时屏蔽的代码部分逐一解决。完成所有相关的修改后,你的移植工作基本完成,下面的工作就是解bugs了。

 

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值