1

We have a VS2012 solution that contains two class library projects, one that produces a Silverlight DLL and one a standard .NET DLL. The class files are shared ("Add as Link") between the two projects.

The upshot is that they both contain a WPF/Silverlight control that inherits from Canvas that we then use within Silverlight and WPF applications.

We are now looking at using the same component within an app to be used on a Microsoft Surface RT. How do I go about building a DLL that can be used like this?

littlecharva
  • 4,224
  • 8
  • 45
  • 52
  • 2
    +1 haven't used them yet, but do the portable class libraries solve that problem? http://msdn.microsoft.com/en-us/library/gg597391.aspx – kenny Feb 25 '13 at 16:40
  • 2
    You may look into [this project on CodePlex](http://xamlmapcontrol.codeplex.com/). It supports all three platform by a common code base. – Clemens Feb 25 '13 at 16:52
  • 2
    Both of you guys should post those as answers, instead of comments... Unless you want me to steal them both and take credit for your knowledge. =) – EtherDragon Feb 25 '13 at 17:45

1 Answers1

1

There's no reason you couldn't do it the same way, you are already doing it if WPF and Silverlight: just create a Class Library (Windows Store apps) project and add existing class files as links to it as well.

You can use conditional compilation symbol NETFX_CORE when you need different code for Windows Store apps:

#if NETFX_CORE
// Windows Store specific code
#endif
Damir Arh
  • 17,637
  • 2
  • 45
  • 83