WPF / Silverlight的VS WinRT的Silverlight、WPF、WinRT、VS

2023-09-02 12:00:51 作者:果冻布丁°

我从来没有真正建在WinRT的应用程序(也没有一个HelloWorld),我非常怀疑。

I never actually built an application (nor a HelloWorld) in WinRT, and I'm very suspicious.

我的问题是,如果有不中WinRT中存在的WPF / Silverlight的功能(这还不包括通过设计不同的方式实现的功能)?

My question is if there are features in WPF/Silverlight that don't exist in WinRT (excluding features that are implemented differently by design)?

和这些方面是最重要的我,是的我的问题的核心,然后在结果,决定是否开始使用WinRT的或等待这些被它执行:

And these aspects are most important to me and are the core of my question, and in result, decision to whether start using WinRT or wait for these to be implemented for it:

在实体框架? 在WCF RIA? 在MVVM支持(棱镜)??? 各种工具包(的Silverlight / WPF工具包),提供额外的控制,比如的DatePicker 等? Entity Framework? WCF RIA? MVVM support (Prism)??? Various toolkits (Silverlight/WPF toolkit), that provide additional controls such as DatePicker etc.?

目前还不清楚我的WinRT是否完全面向.NET或者它是如何工作的。

It's not clear to me whether WinRT fully targets .NET or how it works.

另外,就是WinRT的一个客户只(如WPF)应用程序,或坐在一台服务器(如Silverlight的)?

Also, is WinRT a client-only (like WPF) application or can be ran on a remote client while sitting on a server (like Silverlight)?

另外一个:关于向后兼容,如果我开发一个WinRT的应用程序,将它曾经是怎样能够工作在Win XP

Another one: What about backwards compatibility, if I develop a WinRT app, will it ever be able to work on Win XP?

我反正不明白为什么MVVM不是集成式内部,具有无缝的IDE支持,MVC有。但是这只是一个方面说明。我不能使用XAML没有MVVM,任何应用程序,比你好的世界更容易做MVVM大一点。

I anyway can't understand why MVVM is not integrated inline and has seamless IDE support as MVC has. but that's just a side note. I can't use XAML without MVVM, any app that is a bit bigger than hello world is easier to do with MVVM.

当我谈到了答案,我喜欢WinRT的设计,但问题仍然没有解决,直到我知道上面(EF,WCF的RIA +验证,MVVM,SDK和工具包)提到的具体技术。很显然,我不会开始销售的WinRT应用程序或挖掘到它,直到我有以上技术人员为最少。

As I commented on the answer, I do like the design of WinRT, but the question remains unsolved until I know about the specific technologies mentioned above (EF, WCF-RIA + Validation, MVVM, SDKs and Toolkits). And obviously, I'm not gonna start selling WinRT apps or digging into it until I have the above techs as a least.

结论,作为一个谁他的大部分工作都是LOB应用程序,张望了一下检查后,HTML5 + JS是远远替代SL。因此,对于最后,我坚持SL,并保持它推荐给我的客户。 SL采用最少的开发时间,而且是免费的错误。 JavaScript是一个肮脏容易出错的语言,没有模式,没有nuttn,相比于C#。

Conclusion, as one who most of his work is LOB apps, after checking around a bit, HTML5+JS is far from being an alternative to SL. So for conclusion, I stick to SL and keep on recommending it to my customers. SL takes the least development time, and is bug free. Javascript is a dirty error-prone language, no pattern and no nuttn, compared to C#.

在EF + RIA +棱镜+工具包是完全支持WinRT的,我会考虑考虑我的LOB应用服务地铁的方式。

Once EF+RIA+Prism+Toolkits are fully supported for WinRT, I will consider taking my LOB apps the metro way.

推荐答案

WinRT的基本上是COM对象的集合,它们包装了一堆的Win32 API,公开为CLI兼容的组件。

WinRT is basically a collection of COM objects that wrap a bunch of Win32 API', exposed as CLI-compliant assemblies.

微软修改了他们的C ++编译器来消费和产生 ECMA 335 (即CLI)元数据,而不是更传统的(主要)C ++ / COM-仅MIDL或LIB文件格式。微软还修改了查克拉Javascript引擎也消耗和排放CLI元数据。

Microsoft modified their C++ compiler to consume and generate ECMA 335 (i.e. CLI) metadata rather than the more traditional and (largely) C++/COM-only MIDL or lib file formats. Microsoft also modified their "Chakra" Javascript engine to also consume and emit CLI metadata.

这意味着,针对WinRT中,Javascript和C ++ code,当随着.NET语言,当然也可以消耗CLI标准(即.NET)组件和能发出CLI兼容(如.NET)集

This means that when targeting WinRT, Javascript and C++ code, along with .NET languages, of course, can consume CLI-compliant (i.e. .NET) assemblies and can emit CLI-compatible (i.e. .NET) assemblies.

所以,可以写的WinRT code在C ++中,任何.NET语言(如C#,VB.NET,F#,*铁等),并在Javascript。

So, one can write WinRT code in C++, any .NET language (i.e. C#, VB.NET, F#, Iron*, etc) and in Javascript.

本的WinRT API的将是非常熟悉的你,如果你曾经写过任何.NET code。 Windows团队实际上是寻求帮助和放大器;设计.NET框架设计团队的指导时WinRT的,所以一直指导整个.NET框架团队和大部分.NET社区,为过去11年相同的设计准则已应用到的WinRT API的。

The WinRT API's will be VERY familiar to you if you've ever written any .NET code. The Windows team actually sought the help & guidance of the .NET Framework design team when designing WinRT, so the same design guidelines that have guided the entire .NET framework team and most of the .NET community for the last 11 years have been applied to the WinRT API's.

WinRT的是,坦率地说,美丽的:)

WinRT is, quite frankly, beautiful :)

WinRT中的主要影响是,它取代System.IO的文件,网络,流IO类具有相似的API,但只支持异步IO。这意味着,你将不能够编写阻塞线程,而他们等待的呼叫通过网络文件系统或外部系统,除非你采取明确的步骤来做到这一点,返回的应用程序。

WinRT's primary impact is that it replaces System.IO's file, network, stream IO classes with similar API's but which ONLY support async IO. This means that you will not be able to write apps that block threads while they wait for calls to the filesystem or external systems via the network to return unless you take explicit steps to do so.

这是一个 GOOD 的事情。

幸运的是,新的异步/等待的C#V5和放大器的功能; VB.NET v.next,以及对C特定++的支持意味着你不必去从根本上改变你如何写code在这个新的异步的世界 - 通常你只需要一个异步关键字添加到方法签名调用异步API的,然后使用'等待'关键字prefixing每个异步API调用。

Luckily, the new async/await features of C# v5 & VB.NET v.next, along with specific support for C++ mean that you don't have to go and fundamentally change how you write code in this new async world - typically you just need to add an "async" keyword to method signatures that call async API's and then use the 'await' keyword prefixing each async API call.

我强烈建议你看安德斯·海尔斯伯格的会议这将使这件事很清楚。当你在那里,我也鼓励你看其他几个// BUILD会议,特别是哈利·皮尔逊的谈使用WinRT中使用C#和放大器; VB.NET 并的Mads在异步会议上作出简单的C#和VB 。

I STRONGLY encourage you to watch Anders Hejlsberg's session which should make this whole thing very clear. While you're there, I also encourage you to watch several of the other //BUILD sessions, especially Harry Pierson's talk on using WinRT with C# & VB.NET and Mads' session on Async Made Simple in C# and VB.

我也想建议你看一看的improved我的博客在几个星期前,应让事情变得更清晰。

I'd also recommend that you take a look at the improved Win8/WinRT platform architecture diagram that I blogged a few weeks back which should make things a little clearer.

对于.NET本身,我阐明上面我的帖子,.NET是不是消失。虽然有少数的.NET API的将被禁止在WinRT的应用程序(即阻塞IO的API),你最依赖依然存在,并且是完全可访问的API的了。

As for .NET itself, as I articulate in my post above, .NET is not "going away". While a few of the .NET API's will be prohibited in WinRT apps (i.e. blocking IO API's), most of the API's you depend upon remain and are fully accessible.

关于Silverlight的:Silverlight是一个浏览器插件。这是WPF的修改,子集,并提供了一​​些非常强大的和有吸引力的功能。正因如此,事实上,Silverlight的XAML引擎被转移到核心Windows团队并用于大部分的Metro UI的呈现在Windows8中 - 甚至操作系统本身!

Regarding Silverlight: Silverlight is a browser plug-in. It's a modified-subset of WPF and offers some very powerful and attractive features. So much so, in fact, that the Silverlight XAML engine was moved into the core Windows team and is used for most of the Metro UI rendering in Windows8 - even by the OS itself!

最终的结果是,大多您的Silverlight code将运行得很好几乎没有任何修改,其他的不只是改变了一些用的命名空间。

The net result is that most of your Silverlight code will run just fine with barely any modification, other than just changing a few 'using' namespaces.

有一吨的BUILD 提供XAML为重点的会话来这里观看。

There are a ton of XAML-focussed sessions from BUILD available to watch here.

通过关于向后兼容性,目的是:

With regards backward compatibility, aim to:

要在WinRT中,以及在.NET桌面应用程序,Windows手机等使用到便携式组件尽可能隔离code。 摘要code,需要采取特定平台的依赖性,并考虑手动加载它们,或使用IoC容器来编写的模块组合在一起。

坦率地说,我不认为这是微软的工作就是编写每一个框架,每一个场景。有几种MVVP方法/框架赫然出现在从不同的人有不同的赞成的和反对的野外。如果你没有找到一个,然后创建一个并把它粘起来GitHub上,成为著名;)

Frankly, I don't think it's Microsoft's job to write every framework for every scenario. There are several MVVP approaches/frameworks out there in the wild from various people with various pro's and con's. And if you don't find one then create one and stick it up on GITHub and become famous ;)

首先,虽然,几乎没有从网上下载,并试图在Win8消费者preVIEW及放阻止你; Dev11 Beta版。去让他们尝试一下吧 - 我想你会发现他们很爽快:)

Above all, though, there's little stopping you from downloading and trying Win8 Consumer Preview & Dev11 Beta. Go get them and try them out - I think you'll find them very refreshing :)

HTH。

在回答更新#1为EF,WCF等方面的具体支持:

Update#1 in answer to the specific support for EF, WCF, etc:

您可以在这里找到href="http://msdn.microsoft.com/en-us/library/windows/apps/br211369.aspx">的WinRT API表面面积列举的​​一些细节的