9步搞定Windows8 MetroUI应用移植
2012-05-15 16:55
417 查看
Win8 Metro UI应用的开发是一件非常有趣的事情,特别是它使用了非常奇特的Metro UI设计。如果现有传统UI设计的应用,能够很方便的移植到Win8上,并且也能够充分利用Metro UI的魔力,那么将是非常有有意义的事情。本篇博客就是讲述,在一般情况下,如何将传统UI应用移植成Metro UI应用。
移植工作看上去比较的难,但是按照规律办事,很多事情仅仅是时间和耐心问题。网友不妨使用9步法来完成你的应用移植:
下载并安装Windows 8 Consumer Preview,下载并安装Microsoft Visual Studio 11 Express Beta。
使用Microsoft Visual Studio 11 Express Beta 创建Metro UI应用程序项目,语言可以选择你自己喜欢的C/C++、C#或者Visual Basic等。
将你要重复使用的文件夹、源代码、资源文件等拷贝到你的新项目中,并且在Solution Explorer中选择Show All Filters。
用鼠标右键选择你的文件夹、文件等,将其添加入新项目中。
使用整个项目的查找替换方法,将System.Windows替换成为Windows.UI.Xaml。
拷贝能够重复使用的XAML代码到项目的XAML文件中去(你可以根据需要创建新的XAML文件)。
编译你的项目,使用错误信息快速定位需要修改的地方。使用Windows Runtime APIs替换元代的.NET APIs。
对不能够简替换的代码部分,使用注释将其暂时屏蔽,以便日后慢慢修改。重复7和8的方法直到整个项目完全编译通过。
对暂时屏蔽的代码部分逐一解决。完成所有相关的修改后,你的移植工作基本完成,下面的工作就是解bugs了。
怎么样?是不是比较简单!还不现在动手试一试J。
移植工作看上去比较的难,但是按照规律办事,很多事情仅仅是时间和耐心问题。网友不妨使用9步法来完成你的应用移植:
下载并安装Windows 8 Consumer Preview,下载并安装Microsoft Visual Studio 11 Express Beta。
使用Microsoft Visual Studio 11 Express Beta 创建Metro UI应用程序项目,语言可以选择你自己喜欢的C/C++、C#或者Visual Basic等。
将你要重复使用的文件夹、源代码、资源文件等拷贝到你的新项目中,并且在Solution Explorer中选择Show All Filters。
用鼠标右键选择你的文件夹、文件等,将其添加入新项目中。
使用整个项目的查找替换方法,将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 |
编译你的项目,使用错误信息快速定位需要修改的地方。使用Windows Runtime APIs替换元代的.NET APIs。
对不能够简替换的代码部分,使用注释将其暂时屏蔽,以便日后慢慢修改。重复7和8的方法直到整个项目完全编译通过。
对暂时屏蔽的代码部分逐一解决。完成所有相关的修改后,你的移植工作基本完成,下面的工作就是解bugs了。
怎么样?是不是比较简单!还不现在动手试一试J。
相关文章推荐
- 9步搞定Windows8 MetroUI应用移植
- Android应用升级,加固,自动签名,多渠道打包,渠道信息获取一键式搞定
- MCU51单片机uIP协议栈+ENC28J60网卡 移植、应用
- java/matlab混合编程应用移植到其他电脑上遇到的问题
- [UC/OS-II原理及应用]在51单片机上移植μC/OS-Ⅱ
- Symbian平台移植之——活动规划器CActiveScheduler的灵活应用
- windows8开发-metro应用中页面渐入效果(透明度)
- Windows8邮件应用常用功能使用攻略
- 应用dts在am335x上移植LCD(三)
- Qt应用如何移植到Windows CE系统上
- C#使用Xamarin开发可移植移动应用(1.入门与Xamarin.Forms页面),附源码
- 《BREW进阶与精通――3G移动增值业务的运营、定制与开发》连载之86――不同品牌BREW手机间的应用移植
- windows8开发-应用添加隐私权申明
- 将 Java Web 应用从 Windows 移植到 AIX 时需要注意的问题
- windows8 应用激活
- windows8开发-关于wp7应用迁移到win8 metro风格
- net-snmp的安装配置和移植应用(1)
- 一行代码不用敲,15分钟轻松搞定GIS开发,GISer福音,教你如何从下载到使用webappbuilder创建第一个应用程
- 第三方二进制汇编代码在VC中的移植和应用
- Windows8 Metro/Modern 官方应用