简体   繁体   中英

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?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM