Friday, September 9, 2011

Windows Presentation Foundation(WPF) vs Silverlight

Yesterday I did a session about Microsoft Windows Presentation Foundation in Sri Lanka .NET Forum User Group meeting and it was a great experience. Audience was really friendly and there was some nice questions from the audience. One of the interesting questions is that comparison of WPF vs Silverlight. So today I am going to write a post about Windows Presentation Foundation and Silverlight. Please note that I am getting information for my post from the msdn.

Windows Presentation Foundation(WPF)

Windows Presentation Foundation (WPF) is a next-generation presentation system for building Windows client applications with visually stunning user experiences. With WPF, you can create a wide range of both standalone and browser-hosted applications. The core of WPF is a resolution-independent and vector-based rendering engine that is built to take advantage of modern graphics hardware. WPF extends the core with a comprehensive set of application-development features that include Extensible Application Markup Language (XAML), controls, data binding, layout, 2-D and 3-D graphics, animation, styles, templates, documents, media, text, and typography. WPF is included in the Microsoft .NET Framework, so you can build applications that incorporate other elements of the .NET Framework class library.

Here is a image of sample desktop application created using WPF.

Sample desktop application created using WPF
For more information on Windows Presentation Foundation, please visit the following link.
     Windows Presentation Foundation

Silverlight

Microsoft Silverlight is a cross-browser, cross-platform implementation of the .NET Framework for building and delivering the next generation of media experiences and rich interactive applications (RIA) for the Web. You can also create Silverlight applications that run outside of the browser on your desktop. Finally, you use the Silverlight framework to create applications for Windows Phone. Silverlight uses the Extensible Application Markup Language (XAML) to ease UI development (e.g. controls, animations, graphics, layout, etc.) while using managed code or dynamic languages for application logic.

What Features are in Silverlight?

Silverlight combines multiple technologies into a single development platform that enables you to select the right tools and the right programming language for your needs. Silverlight offers the following features,
  • WPF and XAML. Silverlight includes a subset of the Windows Presentation Foundation (WPF) technology, which greatly extends the elements in the browser for creating UI. Silverlight lets you create immersive graphics, animation, media, and other rich client features, extending browser-based UI beyond what is available with HTML alone. XAML provides a declarative markup syntax for creating elements.
  • Extensions to JavaScript. Silverlight provides extensions to the universal browser scripting language that provide control over the browser UI, including the ability to work with WPF elements. 
  • Cross-browser, cross-platform support. Silverlight runs the same on all popular browsers (and on popular platforms). You can design and develop your application without having to worry about which browser or platform your users have.
  • Access to the .NET Framework programming model. You can create Silverlight applications using dynamic languages such as IronPython as well as languages such as C# and Visual Basic.
  • Tools Support. You can use development tools, such as Visual Studio and Expression Blend, to quickly create Silverlight applications.

For more information on Silverlight, please visit the following link.
     Silverlight

WPF compatibility with Silverlight 4

As I told you before Silverlight offers a subset of the functionality provided by Windows Presentation Foundation (WPF) and enables you to build rich Internet applications that are easy to deploy and quick to install. An additional goal for Silverlight is to enable you to transfer your .NET Framework development experience to Silverlight, and vice versa. You should also be able to port Silverlight applications to the desktop, mainly reusing the XAML.

Since there is a lot of things about this in the msdn site, I will just provide the link. So you all can go through it.
     WPF compatibility with Silverlight 4

Hope you all got a good understanding about Windows Presentation Foundation and Silverlight. Please feel free to give me your feedback.

Happy Coding.

Regards,
Jaliya