PCL version lacks Silverlight 5 support? (EventToCommand..)

Jun 21, 2013 at 11:35 PM
Creating a new Silverlight 5 project and adding the portable version of MVVM Light via NuGet adds GalaSoft.MvvmLight.Platform.SL4 along with the SL5 versions of BCL and Interactivity.

Trying to then use EventToCommand results in the old error about Platform.SL4 being "built with an older version of the Blend SDK."

I assume there simply needs to be a Platform.SL5?

(the intent is of course to use with our own PCL projects, but I created a simple SL5 test project to make sure that they weren't causing problems)
Coordinator
Jun 22, 2013 at 6:40 AM
Hi,

I just created a sample of SL5 mvvm light and PCL and didn't have any issue. A few things:
  • it should not add the SL4 version of the assemblies but the PCL version which does not have a SL* prefix.
  • make very sure that you use the PCL version not only in your library, but also in your application.
I think there is a configuration error somewhere in your project. I can send you the sample I implemented if you want.

Let me know,
Laurent
Jun 22, 2013 at 8:18 PM
Hi Laurent, thanks for replying. Sorry, I guess I should have been more detailed; I was trying to be concise.

My understanding is thus:
  • The PCL version of the assemblies does not support EventToCommand (it simply is not there when viewed in ObjectBrowser). Which makes some sense since it is view-specific.
  • EventToCommand is added by platform-specific assemblies which are included in the PCL NuGet package. (e.g. GalaSoft.MvvmLight.Platform.SL4)
  • To use EventToCommand in the views, the views must be in a Silverlight project (not just a PCL project targeting Silverlight) that references the PCL assemblies as well as the platform-specific assembly (rather than the Silverlight version of MvvmLight which would be incompatible with PCL ViewModels referencing the PCL version).
All I did was create a new default SL5 project in Visual Studio, add MVVM Light PCL via NuGet, and verify that attempting to use EventToCommand caused errors. (nothing fancy, just the simple standard example usage)

Also, I did verify that doing the same with SL4 worked fine (as I expected, since there is a Platform.SL4 but no Platform.SL5).


I assume that your sample project is not actually using EventToCommand in SL5? If I'm wrong, I would indeed be happy to see your sample.
Jul 17, 2013 at 8:00 PM
I have updated the PCL Nuget package to include a SL5 platform assembly that uses the SL5 interactivity libs.