There are three aspects that will need to be used:
- Code files (e.g. * .cs * .vb)
- XAML files (including themes)
- Project files (such as * .csproj and * .vbproj)
As Yaroslav noted, you can use conditional complication for code files, which is supported by C # and VB.Net . Keep in mind that Silverlight projects will by default define the SILVERLIGHT symbol, so you can use this in your conditional statements.
Another trick for code files is to use partial classes . This allows you to place entire blocks of code that can only be applied to Silverlight or WPF (but not both) in a single file. Then selectively include this file in your project.
Xaml files are a bit more complicated since WPF supports several things that are not supported by Silverlight (like custom MarkupExtensions, etc.). In practice, I simply duplicate XAML files and compress as needed.
Project files must be supported manually, which is not so difficult.
source share