简体   繁体   中英

Code Sharing between Windows Phone 7 and Windows Phone 8 / Windows 8 (Windows Store)

I have a Silverlight 4 class library written in C# that I use as common code for my Windows Phone 7 projects.

What I want is to use this (basic, platform-independent) code in my Windows Phone 8 and Windows 8 Apps too.

Is there any way?

It's not strong-necessary that the common code has to be stored in a Silverlight 4 (v5 seems not supported by WP7) project.

Set the common code up as a "portable class library" project, targeting the platforms you want (Silverlight and Windows Store in this case). This gives you access to the intersection of those frameworks. This can then be referenced and used by the framework-specific shell projects.

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