views:

107

answers:

3

I was working with a WPF application and I decided that the controls and graphics I wanted to display on the grid might look better if it was a silverlight component.

I thought this way because of all the cool silverlight controls that look very flash-like.

But now that I have gottem my Visual Studio 2010 set up with SIlverlight, it seems that every silverlight app I can make are ASP.NET in nature. It seems that instead of a cool GUI control to make, Silverlight is telling me that it is primarely a dataflow sort of application for the web.

What is the relationship, if any, between WPF and Silverlight. Can I or can I not put a silverlight control into my existing WPF application?

+3  A: 

It's my understanding that Silverlight is like "WPF lite", and that in many ways they are almost the same thing but made for different purposes (desktop vs. web). If you want your wpf application to have a different look, you don't need to bring in any other controls from silverlight, because you can simply re-style or re-template them to suit your needs (which you can also do in silverlight). But you can't simply use silverlight controls in wpf because they're compiled to run on different runtimes.

Silverlight does have a number of un-official controls in the silverlight toolkit which are not included in wpf or the wpf toolkit. They are open source, and if you really want, you could port them to wpf, especially since the code is very similar to wpf.

Benny Jobigan
+1, all good information. To be technically correct, Silverlight is a subset of WPF based on the compact version of the .NET Framework. So while much of the foundation is quite similar, Silverlight is lacking some of the rich libraries that WPF provides.
Charlie
+1  A: 

Silverlight is essentially a subset of WPF that is used to create web-based applications.

You might be able to jump through some hoops to get a limited Silverlight application running in WPF, but I doubt it would be worth it...

Justin Ethier
A: 

I know others may point out that SL is WPF lite.

But hope you find out they are different frameworks at least right now though they share XAML, and a similar model.

Not sure if in the future they become the same, but keep the differences in mind is critical at this moment. :)

We know DevExpress is now shipping the same code base of their components for WPF and SL, but that does come after putting a lot of efforts.

http://community.devexpress.com/blogs/ctodx/archive/2010/04/20/merging-our-silverlight-and-wpf-ui-controls.aspx

Lex Li