Is there any way to write a WinRt (Metro) app that will also work on Windows 7 and Vista?

后端 未结 5 588
独厮守ぢ
独厮守ぢ 2021-02-06 23:47

We can’t just leave our customers that are not able to upgrade to windows 8 for a long time in the larch. However there is demand for a “tablet”/”touch” versio

5条回答
  •  礼貌的吻别
    2021-02-07 00:26

    The best answer is that you do not want the same application to run on Windows 7 and Windows 8 Metro style. The UI that works best for mouse and keyboards (windows 7) will not work well for a touch-first presentation and visa versa. It is important to re-imagine the UI for the two different worlds.

    That said, you have 2 options if you want to share a lot of the code: 1) Write it largely in JavaScript/HTML5. This will let you re-use many of the assets (especially the business logic parts). 2) Write it in (desktop) Silverlight. The Silverlight XAML is closest to Windows XAML. WPF is further away and will require more re-work later.

    In either case, you should look at and follow the principles used when writing cross-platform code. Understand the platform dependencies and isolate them behind indirection boundaries. You want to localize all of the code that will have to change. For instance, you don't want calls to the .Net System.IO.File APIs which you know will have to change to Windows.System.Storage calls being scattered throughout your code. Instead, you want it localized in one function that can be modified later.

提交回复
热议问题