Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Silverlight vs WPF [closed]

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?

like image 927
Craig Schwarze Avatar asked Dec 04 '22 13:12

Craig Schwarze


2 Answers

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.

like image 65
LBushkin Avatar answered Jan 01 '23 07:01

LBushkin


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.

like image 43
Reed Copsey Avatar answered Jan 01 '23 08:01

Reed Copsey