将WPF应用程序转换为SilverLight

问题描述:

是否可以将现有的WPF应用程序自动/轻松地转换为SilverLight?

Is it possible to convert an existing WPF Application to SilverLight automatically/with minimal effort?

不是.我发现了一些有关多目标选项的文章="http://blogs.msdn.com/dphill/archive/2008/08/31/hello-prism-2-0.aspx" rel ="noreferrer"> WPF和Silverlight 同时出现.目前,如果您没有使用 PRISM ,幸运的是,同时针对这两个目标可以实现的.

Not really. I have found some articles regarding the multi-targeting option for WPF and Silverlight at the same time. At this moment, if you are not using PRISM, it is quite a challenge to target both of them, fortunately achievable.

您需要牢记的是,Silverlight使用的库比WPF小(因此限制更多).

What do you need to have in mind is that Silverlight uses a smaller (thus more limited) library than WPF.

针对评论: 实际上,PRISM已经支持Silverlight( v2 ) . PRISM的想法不仅是为使用WPF,而且还通过

In response to the comments: Actually, there is already support for silverlight in PRISM (v2). The idea of PRISM is to provide guidance to developing applications not only using WPF but using Silverlight also - Prism V2 formally was known as Composite Application Guidance for WPF and Silverlight. By using PRISM for silverlight capabilities, it would give you the warranty that your code would work on both platforms with minimal changes, if none (except maybe the different project types for visual studio).

但是,当然,如果您已经开始开发应用程序,则需要更改代码以使用PRISM.

But of course, if you already started developing your application, you would need to change your code to use PRISM.