2

I want to migrate my Windows Phone 7 App, to a Windows 8.

I started doing it after this Documentation: http://msdn.microsoft.com/en-us/library/windows/apps/hh465136.aspx

Those are the steps:

  1. Launch Microsoft Visual Studio Express 2012 RC for Windows 8 and create a new Metro style app using C++, C#, or Visual Basic. Choose a project template that best matches your app layout and functionality. For more info, see Jumpstart your Metro style app using templates (C#, C++, Visual Basic).

  2. Copy the folders, code, and asset files that you want to reuse in the new project.

  3. In the Visual Studio Solution Explorer, click Show All Files.

  4. Select the files and folders that you copied, and then right-click them and select Include In Project.

  5. Perform a global search and replace to replace "System.Windows" with "Windows.UI.Xaml".

  6. Copy the reusable parts of your original XAML code into the new project's XAML files, or into newly created XAML files as necessary. You can often copy and reuse the contents of page layout roots (typically Grid elements), but not the outermost elements (typically PhoneApplicationPage elements).

My Question starts at point 2: Let's say i have a page: Settings.xaml and Settings.cs. Do i have to copy both of them or none and add the code later? If I add Settings.xaml i get an error because of the tag:

  <phone:PhoneApplicationPage ...> 

like it says at point 6.

I dont have any Problems with my dll's or with my "normal" classes, which arent connected to a xaml.

And when i create a Windows 8 Page i don't know where to add my Code from WP7 in Windows 8

 <Grid Background="Transparent">

  .....Code.....

  </Grid>

I hope you guys can help me out.

4

2 に答える 2

2

すべてのファイルを直接コピーする代わりに、新しい Windows 8 プロジェクトを作成し、適切な XAML 要素と C# をコピーすることで、ColinE に同意します。別のサポート .cs ファイルを作成した場合、それらは正常にコピーされるはずですが、コードがすべてファイルにまとめられている場合は、コピーするメソッドとそれらを配置する場所を把握する必要があります。

使用するアプリの種類 (空、グリッド、分割など) に関しては、アプリケーションとその目的によって異なります。アプリの UX の設計に関する記事を参照して、アプリに最適なものを見つけてください: http://msdn.microsoft.com/en-us/library/windows/apps/hh779072

Windows Phone 7 アプリを Windows 8 Metro アプリに移植する方法について説明している別の MSDN 記事を次に示します

それが役立つことを願っています!

于 2012-07-31T15:42:31.357 に答える
1

おそらく、XAML ファイルに取り組む最も簡単な方法は、Visual Studio を使用して Win8 プロジェクトで新しいユーザー コントロール/ページを作成することです。その後、XAML を WP7 から Win8 に切り取り、1 つずつ貼り付けることができます。このプロセス中にコード ビハインド全体をコピーすることもできます。

XAML / cs ファイルを直接コピーできるようにするには、あまりにも多くの変更がいくつかあります。

于 2012-07-31T13:11:10.550 に答える