9步搞定Windows8 MetroUI應用移植

來源:互聯網
上載者:User

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。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.