Freigeben über


When should I use WPF vs. Silverlight?

In my role, I work with a number of large corporations, and this is a question that they ask me regularly: What is the difference between the Windows Presentation Foundation (WPF) and Silverlight, and in what scenarios does it make sense to use each? 

Microsoft feels that user experience is important, and invested in multiple technologies to promote better user experience.  Both WPF and Silverlight use XAML (Extensible Application Markup Language) under the covers. 

Let's look at some of the different characteristics of each technology:

 

WPF:

  • Ships as part of the .NET Framework (version 3.0 and onward)
  • Runs as Windows application or as web "browser application" (called XBAP, for "XAML Browser Application").  Note that XBAPs run only in Internet Explorer with .NET 3.0 and in both Internet Explorer and Firefox with .NET 3.5.  
  • Runs on Windows machines only (Windows XP, Windows Server 2003, Windows Vista, and Windows Server 2008)
  • Richest functionality, including 3D graphics

Silverlight:

  • Ships independently
  • Runs in web browsers only (Internet Explorer, Firefox, Safari)
  • Runs on Windows or Mac operating systems (also on Linux via Moonlight, which is an open source implementation of Silverlight based on Mono)
  • Functionality is a subset of WPF's feature set

 

When should you use each?  The maddening answer is (of course): it depends! 

WPF is a more mature technology and was designed with a richer feature set.  It also has the advantage of being able to run in a browser or as an installed Windows-Form-type app. 

Silverlight has a broader reach.  You can access Silverlight from many operating systems and web browsers

The most important reason to choose one over the other should be based on the intended audience for the application.  For example, if a corporation is designing an application for internal use only and every employee has Windows XP as the company standard OS, then go with WPF to leverage the richer feature set.  If a corporation is designing an external-facing website, then Silverlight is the better choice because potential customers can access the website from a variety of different operating systems and browsers.

Comments

  • Anonymous
    May 06, 2008
    Easy choice for me, WPF requires too steep of graphic requirements for the corporate environment. Wish I could use it, but reality is it just isn't meant for the corporate PC world.

  • Anonymous
    May 06, 2008
    When should you use each? Is only a question because to pull it of Microsoft does not have a complete cross technology platfrom with different views into the model. Now the question is if you use both or multiple including asp.net. How can we have a single Model View Controller (MVC) type foundation/framework. Why is there a seperate library for WPF one for ASP.NET and yet to be announce one for SilverLight. Could there be a single Model, and Controller with the views being used for the given platform without having to (re)write a SilverLight Model and a WPF Model. How about just a seperate View built in SilverLight and one built in WPF and one Built in ASP.NET yet they all share the same Model and Controller? Could Microsoft now come up with a single MVC framework that cross all Presentation bounds without having multiple frameworks?

  • Anonymous
    May 06, 2008
    Isn't it only two operating systems, Windows and MAC?

  • Anonymous
    May 06, 2008
    What? WPF applications (.exe) can run on web browsers? I need to get my Imagine Cup Interface Design entry (http://filipefreitas.net/blog/?p=1157) on my blog ASAP for everyone to see!

  • Anonymous
    May 22, 2008
    The comment has been removed

  • Anonymous
    June 23, 2008
    The comment has been removed

  • Anonymous
    July 11, 2008
    BTW, your blog entry has been plagiarized without due credit: http://kranthikiran.wordpress.com/2008/05/27/when-should-i-use-wpf-vs-silverlight/

  • Anonymous
    January 25, 2009
    The comment has been removed

  • Anonymous
    May 26, 2009
    This is very clearly understand for difference between Silverlight and WpF

  • Anonymous
    July 22, 2009
    Abe yaar I havent use it till now...

  • Anonymous
    August 06, 2009
    Silverlight now supports embedding fonts...problem solved!! http://www.switchonthecode.com/tutorials/silverlight-3-custom-fonts

  • Anonymous
    September 12, 2009
    Hi! I was reading in other web-site you can run Silverlight OOB on Windows. Is it right? In other words. Can we run a silverlight (no WPF) application Out of Browser? Thanks in advance. Regards, Ricardo

  • Anonymous
    October 13, 2009
    Hi Ricardo Ricardo, Yes, that's true. Check out silverlight 3 official site (http://silverlight.net/getstarted/silverlight3) for new features information.

  • Anonymous
    December 19, 2010
    Nice and understandable article. Thanx.

  • Anonymous
    December 04, 2012
    Hi All If WPF and Silverlight are both one and same then why Microsoft deperated them? Is Silverlight provides light weight applications than WPF? Whether WPF have lot of headers so that web applications cannot able to hold such large headers? There might be a crucial difference(Based on my understandings). Thanks in advance

  • Anonymous
    May 06, 2013
    Bundle of thanks.....that was really an concise and informative points that really gives a basic and a more better understanding... Once again thanks ...