views:

1915

answers:

10

Silverlight 3.0 beta has just been announced at Microsofts Mix Conference in Las Vegas.

Two features of the new beta are 3D-graphics and the ability to run applications outside of the browser, which to me seemed to be two of the major features that WPF (Windows Presentation Foundation) previously offered over silverlight.

I am currently evaluating WPF and Silverlight for possible use in our companies future development activity, and this announcement has left me confused as to the intended direction of these two UI technologies and why I would choose one over the other.

Has anyone implemented a new application using WPF recently, and if so, what drove you to that decision? Given the announced changes to silverlight, Would your decision have changed had you made it now, and if not, why?

Any advice would be appreciated.

A: 

I recently have built several internal tool using wpf, and I chose it simply because It was easier for me coming from win32 work. I don't really think that the differences are major, and really... everything i have seen/heard indicates that porting between wpf and silverlight is quite easy.

chills42
+11  A: 

I would say the main difference is that WPF requires the client to have the .Net 3.0+ framework. Silverlight only requires the runtime. Now that being said, WPF is geared more for controlled environments such as an intranet. Silverlight is meant for the public web. Another difference is that Silverlight is cross platform (Windows, Mac, Linux in the future & Cross browser). WPF is meant for Windows only.

The .Net framework can be a huge download for some users. Silverlight is only 4-5MBs. This is a big difference to run your app on the web, but not a big issue if its an internal application at your company.

Silverlight is Sandboxed which is meant for web use. So if your app requires more permissions you will need WPF.

There are also some differences between Silverlight code and WPF. But from what I've heard, the ultimate goal is to get a Silverlight to run inside of WPF with minimal code changes. But they aren't there just yet.

irperez
Good answer. One Side note though, WPF xbaps run in firefox as well
Jacob Adams
+3  A: 
  • Has anyone implemented a new application using WPF recently, and if so, what drove you to that decision: Well since WPF was desktop only (or browser based using XBAPS - but that was more a deployment system than a real system) that was a good reason to it.
  • "Would your decision have changed had you made it now, and if not, why?" - No Silverlight, even on the desktop in v3, is still highly sandboxed and so certain functions are going to be hard/impossible to do due to the sandbox. Also the ability to use DirectX parts in WPF will still give another optimisation area which Silverlight and it's 3d won't be able to use.
Robert MacLean
That is a good point. Since Silverlight doesn't really have any unmanaged interop, you must use WPF if you want to use P/Invoke or COM objects.
Andy
+4  A: 

Silverlight is basically a stripped down version of WPF in order to make the runtime libary download as small as possible.

As a result, WPF simply has a lot more functionality available in it and tasks that are simple in WPF often become not so simple in Silverlight.

If running as a web app is not a requirement then the decision is a no-brainer - WPF all the way.

17 of 26
Note that WPF can also run as a web app (by deploying as XBAP), but the client must have Windows whereas with Silverlight the client can be Windows, MacOS or Linux.
Ray Burns
+6  A: 

I have just worked on a WPF project that in hindsight we feel we might have chosen SilverLight for. It is probably more important to know the differences and select the one that is most appropriate for what you're doing.

Here's my starter for ten on some of the important differences - there were originally some differences in the available controls, but that has largely been smoothed out now.

Silverlight

  • Runs entirely on the client with AJAX calls to the server for data
  • Can run on any server, including Windows and Linux / Apache
  • Uses COMPACT .NET framework

WPF

  • Runs on the client... usually calls services for data
  • Runs on Windows XP / Vista with .NET 3.5
  • Utilises the entire .NET framework
Sohnee
Silverlight shouldn't be using AJAX unless you're a masochist! The big advantage of SL is no javascript. Async SL comms is the same idea as AJAX just a hell of a lot easier.
sipwiz
Xbap and xaps are both static resources. Therefore, both can be hosted anywhere, Windows, Linux, etc.
Jacob Adams
+11  A: 
Klinger
Wow, you wrote that in a strange way. Why not say "Use WPF over Silerlight when": Graphics Performance is a priority, etc... Use positives instead of negatives. Just a thought.
Arron
I agree with you but I was just giving info for a decision not the decision itself.Also, I am ESL, so, please, forgive my poor English skills. :-)
Klinger
+2  A: 

I'm well along in the development of our first WPF app for release. Silverlight 3 looks great, but for this application I would still have chosen WPF. The application centers around presenting and manipulating very large sets of images hosted on a central server on our clients' networks. Additionally, the software update/change rate will be minimal. Mass import of new images from a local drive, no Internet connectivity requirements, performance concerns, etc. make this a project well suited for WPF.

One of our upcoming projects, however, will require many remote users to access a single data store on our network. The data they work with requires significant validation and error handling, so running that code locally is ideal. They will need the ability to work both on and offline and remain in synch (probably with SQL Data Services). SLOOB (Silverlight Out Of the Browser) will most likely be our choice for that one so they can have all the Silverlight advantages but use it like a regularly installed application, even without an Internet connection.

Both formats have their place: the trick will be to avoid using Silverlight for everything - we have more tools than just 1 hammer. :-)

Joel Cochran
+3  A: 

It's worth noting that Silverlight's 3D is not the full 3D support of WPF, but only projection of 2D into 3D - i.e. take the 2D plane and allow rotation in X, Y & Z directions. WPF has full 3D modelling with materials, view ports, lighting and camera positional support etc.

Gordon Mackie JoanMiro
+1  A: 

Another difference is that with SL you only have one 'window', you can't have dialogs (they can be simulated but their size is limited to the main window) and you can't add multi monitor support.

If you have to interact with existing business applications (e.g. open a document in the archive viewer) you need to use WPF.

chris
A: 

Storage: You only have 25MB of isolated storage out-of-browser. If I remember correctly from some mix09 video, this limit is lower if your app is in-browser.

http://bliny.net/blog/post/Out-of-Browser-with-Silverlight-3.aspx

No FlowDocument: So there are limitations there too.

Artur Carvalho
You can ask the user to allow an increase of the space, however.
dhopton
Ah, good info, thanks dhopton.
Artur Carvalho