Win8 Metro UI application development is a very interesting thing, especially when it uses a very strange Metro UI design. If the existing application of traditional uidesign can be easily transplanted to Win8, and the magic of Metro UI can be fully utilized, it will be very meaningful. This blog is about how to port a traditional UI application to a Metro UI application.
Porting seems difficult, but according to the rules, many things are only time and patience problems. You may wish to use the 9-step method to transplant your application:
- Download and install Windows 8 consumer preview, and download and install Microsoft Visual Studio 11 express beta.
- Use Microsoft Visual Studio 11 express Beta to create a Metro UI application project. You can select your preferred C/C ++, C #, or Visual Basic language.
- Copy the folders, source code, and resource files you want to reuse to your new project, and select show all filters in Solution Explorer.
- Right-click your folder and file and add it to the new project.
- Use the search replacement method of the entire project to replace system. Windows with 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 |
- Copy the reusable XAML code to the project's XAML file (you can create a new XAML file as needed ).
- Compile your project and use the error message to quickly locate the location to be modified. Use Windows runtime APIs to replace. Net APIs of the Yuan Dynasty.
- For the code that cannot be simply replaced, use comments to temporarily block it so that it can be modified later. Repeat Methods 7 and 8 until the entire project is fully compiled.
- Solve the code parts temporarily blocked one by one. After all the relevant modifications are completed, your migration is basically completed. The following work is to solve the bugs.
How is it? Is it relatively simple! Try J now.