littlecharva
littlecharva

Reputation: 4244

Coding for Silverlight, WPF and Windows RT

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?

Upvotes: 1

Views: 558

Answers (1)

Damir Arh
Damir Arh

Reputation: 17855

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

Upvotes: 1

Related Questions