I am new to the WPF and Silverlight and Prism 4 , Can we create an Application that is usable both in WPF and silverlight or do I have to have different projects for both? My question is Can I use Prism to create an Application that is usabl开发者_运维技巧e both in WPF and Silverlight , If not how do I go in that direction?.
You absolutely can use PRISM to create an application that is usable by both WPF and Silverlight. You will have to be careful how you use certain features (that don't easily cross between both), but its very doable. In fact, the stock trader sample application that comes with PRISM does this exact thing.
Here is a great article that explains how: http://msdn.microsoft.com/en-us/magazine/ee321573.aspx
I am not sure if Prism changes this, but the core Silverlight assemblies are different than the core .NET assemblies thus a Silverlight project will always build as a Silverlight project. If you focus on a layered web services architecture with thin clients then the maintenance of WPF and Silverlight should be minimal.
Further you can share common entity libraries between the two by creating an entity project, and then a silverlight project that contains references to your domain model classes. In this way identical domain model assemblies can be built for both Silverlight and .NET core applications and they can even be passed back and forth to web services utilizing WCF services.
Have a look at this. It seems Microsoft is trying to solve this too.
精彩评论