有什么方法可以编写在Windows 7和Vista上也可以使用的WinRt(Metro)应用程序? [英] Is there any way to write a WinRt (Metro) app that will also work on Windows 7 and Vista?

查看:57
本文介绍了有什么方法可以编写在Windows 7和Vista上也可以使用的WinRt(Metro)应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们不能只让长期无法升级到Windows 8的客户留在落叶松中.但是,需求是我们应用的平板电脑"/触摸"版本.

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" version of our app.

那么我们如何才能在一个代码库中既支持Windows 8上的Metro触摸又支持我们的现有客户?

So how can we support both touch with Metro on Windows 8 and our current customers from a single code base?

当WPF出现时,在经过多次推动"之后,Microsoft看到了它并使其可以在Windows XP上运行–对于WinRT来说,有这样的话题.

When WPF come out, after a lot of "Pushing" Microsoft saw since and make it work on Windows XP – has anything like this been talked about for WinRT.

(由于XP支持正在缩减,我不希望有任何解决方案可在XP上使用.)

(I am not expecting any solution to work on XP, as XP support is being wound down.)

另请参阅:可以使用ARM版本的Windows 8仅运行Metro(WinRt)样式的应用程序吗?

推荐答案

最好的答案是,您不希望同一应用程序在Windows 7和Windows 8 Metro风格上运行.最适合鼠标和键盘(Windows 7)的用户界面不适用于触摸优先演示,反之亦然.重新想象两个不同世界的用户界面非常重要.

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.

也就是说,如果您想共享很多代码,则有两个选择: 1)大部分用JavaScript/HTML5编写.这将使您重用许多资产(尤其是业务逻辑部分). 2)将其写入(桌面)Silverlight. Silverlight XAML最接近Windows XAML. WPF距离很远,以后需要做更多的工作.

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.

在任何一种情况下,您都应查看并遵循编写跨平台代码时所使用的原则.了解平台依赖性并将它们隔离在间接边界之后.您想本地化所有必须更改的代码.例如,您不希望对已知的.Net System.IO.File API的调用必须更改为Windows.System.Storage调用,这些调用分散在整个代码中.相反,您希望将其本地化为一个功能,以后可以对其进行修改.

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.

这篇关于有什么方法可以编写在Windows 7和Vista上也可以使用的WinRt(Metro)应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆