Windows RT and c#

后端 未结 3 974
说谎
说谎 2020-12-15 12:03

I need to develop Metro style application using C# and XAML which has to work on Windows RT devices and full Windows 8 OS. So I\'m allowed to use only WinRT without any .net

相关标签:
3条回答
  • 2020-12-15 12:34

    Let me answer you in the most direct way I can. If you open a Blank XAML/C# Windows Store project. That project will run on Windows RT (ARM) and Windows 8 (x86/x64). That's because it is built to accomplish this. Just because you have what feels like the .Net Framework, don't worry - you are writing a cross-platform application.

    Now, for the caveats. You made this answer easy because of C#. CPP developers don't have the same guarantee because there are coding things they can do to break this compatibility. Not so in C#. If the code you write compiles to "Any CPU" then what I am saying is correct.

    If you introduce something (like the Bing Maps control) that requires your build to change from "Any CPU" to something else. The Windows Store will let you submit three versions of your app under the same name - one for each platform - and the user will never know there is more than one.

    In that last example, you are still supporting every platform, you just have to specific three different builds to accomplish it – your code may not change at all! In most scenarios, you support them all out of the gate. If you introduce a third party library - like MVVMlite - you are still okay if you can build to any CPU. Most libraries are cool like that.

    0 讨论(0)
  • 2020-12-15 12:47

    If you make your libraries portable class libraries, you can use them for desktop, metro, and phone apps (and xbox too). You can choose this when you start a library, or in the project's properties. It makes it easier to write cross platform apps within the mircrosoft ecosystem.

    0 讨论(0)
  • 2020-12-15 12:49

    It's not quite correct to say you can't use the .net framework in Metro style apps. More correctly, there is a version of the .net framework which is only available for metro apps. If your assemblies were not built with this version of the .net framework they will not work for metro. This version of the .net framework will work on .86 and arm. There is also a version of MVVM Light for metro apps. Download it here. See here for details on developing for arm.

    Regardless of whether you’re using JavaScript, C++, Visual Basic, or C#, if you’ve built a Metro style app that targets x86/x64 then you already know how to build one that targets ARM. You use the same Metro style project templates, which provide the starting point for building an app.

    Edit: As Jerry points out, you may have to compile your application against different versions of libraries if they are written in C++, but that's a matter of having separate builds rather than having to do additional development.

    0 讨论(0)
提交回复
热议问题