0

Iam creating a User control in WPF and I need to implement the same user control in Silverlight also. Is it possible to use the user control in Silverlight as .dll (or) .xaml format....?

ognale88
  • 169
  • 3
  • 7
  • 19

2 Answers2

0

Basically, Silverlight supports a sub-set of code available to WPF developers. Rather than go into all the details here, I would instead advise you to read the answers provided to a similar posted question and preferably search the existing posts before you ask already asked questions:

WPF vs Silverlight

Community
  • 1
  • 1
Sheridan
  • 68,826
  • 24
  • 143
  • 183
0

Silverlight is only a subset of WPF. WPF requires full set of .Net framework, while Silverlight only need Silverlight run-time which is a subset of the .Net framework. So you can not referencing WPF control library in Silverlight project because there is no way you can use those controls in Silverlight application.

However, sometimes you might need certain WPF features that are not available in Silverlight, one example might be converting drawing in Canvas to a bitmap image since Silverlight does not have any function available to convert that drawing in Canvas to a image. In those cases, you can use a WebService to call WPF code running on the Server to accomplish those tasks.

Idealy, if you create controls in Silverlight, you should be able to move them to WPF project without much effort. Even that is not guaranteed by MS at this time. But definitely not the other way around.

according to

http://social.msdn.microsoft.com/Forums/silverlight/en-US/f66e2b20-000c-4e56-8c3c-0af417107fc8/cannot-add-wpf-control-library-to-silverlight-project#7e91bad0-270d-4135-9110-880ce020d36f

SeyedPooya Soofbaf
  • 2,654
  • 2
  • 29
  • 31