How can I MultiTarget Both SilverLight 4 and WPF Application ?
Asked
Active
Viewed 319 times
2 Answers
4
The standard approach is to create a solution that contains a WPF project and a Silverlight project, both created using the new project wizard or one can be your existing project. Then add files in one project to the other project using links (Add -> Existing Item -> Add -> Drop-down arrow -> Add as link). Then use #if SILVERLIGHT
to handle any platform differences.

Rick Sladkey
- 33,988
- 6
- 71
- 95
-
1I should note that on occasion, you'll actually be able to re-use XAML files as well, but it's pretty rare. You should plan on redoing all your XAML on both platforms. But you should try really hard to get your Model and ViewModel layers to compile on both Silverlight and WPF, so that your UI layer is the only layer that you need to change. – Ken Smith Feb 07 '11 at 07:29
1
As far as I know you will probably work with compiler flags. Why not learn from a project that does target WPF, Silverlight etc.? You could e.g. check out Caliburn.Micro

flq
- 22,247
- 8
- 55
- 77