开发者

Silverlight vs WPF [closed]

开发者 https://www.devze.com 2022-12-16 00:59 出处:网络
Closed开发者_如何学Go. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citati
Closed开发者_如何学Go. This question is opinion-based. It is not currently accepting answers.

Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.

Closed last year.

Improve this question

My organization is considering which technologies to use for our next generation of systems. We will be using .NET, but have not decided which user interface technology is best. Silverlight and WPF seem to be the most appropriate options. Can someone share the pros and cons of each approach?


As Gabriel (and Reed) mention, Silverlight is a slimmed down version of WPF.

WPF is intended primarily for desktop applications, and it has advanced features around layout, animation, and data binding that Silverlight does not yet have. WPF can be delivered via a browser, but it does not run as a browser plug in, and so cannot interact with any other content in the browser. It is possible to create WPF applications that host WinForms controls and windows - this can make it easier to transition a portfolio of existing WinForms code (if that matters to you). WPF also has more sophisticated 3D capabilities than Silverlight - though not by much.

Siverlight, is available on multiple platforms (like Linux and OSX) via the Mono runtime and the Moonlight port of Silverlight. Silver light can either run as a stand-alone app, or within a browser environment - which makes it possible to create web-based applications. When run as a browser-based plugin, a Silverlight app can interfact with the content in the browser, and can be displayed side-by-side with HTML. You can also manipulate a Silverlight app using JavaScript - creating a near-seamless programming environment. There are some limitations in Silverlight apps - for instance, WCF calls are all asynchronous (due to the Silverlight/Browser threading model). Also, not all of the .NET framework SDKs are available to Silverlight apps.

Both technologies are very similar in that they use a combination of markup and code to deliver functionality. To choose between them, you need to decide whether you are building a browser-based or stand-alone application, whether you want to be portable to other platforms, and whether you need the full suite of libraries available in .NET.

On the development tools front - the best tool out there IMHO is Expression Blend - it has an elegant and powerful UI for visually creating either WPF or Silverlight user interfaces. It also integrates with Visual Studio - which is still a superior development environment (Blend has limited code editing features). There are also tools like Expression Design and Expression Encoder to help with creating graphics and manipulating video for use in both WPF and Silveright applications.


Silverlight is far less capable than WPF, even in version 4.

It can run in a browser or out of browser, and has some advantages - but the main advantages of Silverlight over WPF are deployment related. It is very easy to deploy a Silverlight application - just refer to the XAP in a webpage located on your server, and it's deployed (provided your users have Silverlight installed). WPF requires a bit more work in terms of deployment, since it's a full desktop application.

That being said, WPF provides far more capabilities. It provides access to the full .NET framework (as opposed to a [growing] subset).

My personal preference would be to use Silverlight - provided the application did not require interop with legacy software, access to resources on the system, or other things unavailable within Silverlight. If, however, you need to do anything that will tax the system (ie: heavy computation where you want parallelism, use of graphics resources, complex 3D work, etc), then WPF is the way to go.


Silverlight is a subset of WPF that is used in the Silverlight browser plugin. Both are good, but you have to decide whether you'll end up with a web-based or a windows application.

Silverlight doesn't have all of the capabilities that WPF does (partially for security reasons - it is used in the browser). With Silverlight, though, you have access to all of the rest of the web based application advantages (single upgrade location, etc. - JavaScript, CSS, and HTML).

0

精彩评论

暂无评论...
验证码 换一张
取 消