2

Is Silverlight a subset of WPF? If i learn WPF then can i say i know Silverlight too?

Asdfg
  • 11,362
  • 24
  • 98
  • 175

2 Answers2

3

Silverlight is similar to WPF, and actually started out as WPF/E (WPF Everywhere) but at some point, it became a separate implementation and it is not directly compatible with WPF.

That said, most of the techniques and classes that you would learn in WPF will have a Silverlight variant. One primary exception being the 3D visualization facilities in WPF are not available in Silverlight.

Silverlight is still coded in a Silverlight-specific .NET run-time (a slimmer version than the full .NET run-time) and you still use XAML to describe your presentations.

It should also be noted that Silverlight does have built-in restrictions with accessing resources on the machine it is running on. For example, Silverlight applications can not access the registry. There are enhancements in Silverlight though that do allow for "out of browser" applications which can be given full-trust privileges.

Dave White
  • 3,451
  • 1
  • 20
  • 25
0

The one big difference between Silverlight and WPF is the CLR (Common Language Runtime) and that Silverlight is Sandboxed, so you don't get alot of functionality you can get with WPF.

If you know WPF XAML and Model-View type aspects of programming styles with e.g Dependency propertys then you will find it quite easy to use Silverlight.

One big thing with Silverlight is that you cant reference C# non silverlight classes, you must use these types of classes via WCF.

Robbie Tapping
  • 2,516
  • 1
  • 17
  • 18
  • what do you mean by "non silverlight classes". Does it mean Custom classes that we create like Customer or Order? – Asdfg Apr 22 '11 at 00:11
  • Yes If they are not created in a Silverlight C# class project you wont be able to reference them inside your Silverlight project. – Robbie Tapping Apr 22 '11 at 00:59
  • Also heard that in Framework 4.0, it uses XAML 2009. No idea what it is but it looks like its a markup language sort of a thing? – Asdfg Apr 22 '11 at 01:36
  • 2
    The important thing to know is that the Silverlight .NET runtime is NOT the same as the full .NET runtime that we have on a PC or webserver. That is why anything that is created for the FULL .NET runtime won't work in a silverlight application because they aren't the same binaries. – Dave White Apr 22 '11 at 16:13