"System.ComponentModel.INotifyPropertyChanging" in two places with portable MVVMLight libraries

I am getting this funny error when I try to add a local database to my Windows Phone 8 project.

The "System.ComponentModel.INotifyPropertyChanging" type exists in both: e: \ users \ keenan \ Documents \ Visual Studio 2012 \ Projects \ MAL.WindowsPhone \ packages \ Portable.MvvmLightLibs.4.1.27.1 \ Lib \ KP8 \ GalaSoft.MvvmLight.dll "and 'C: \ Program Files (x86) \ Reference Assemblies \ Microsoft \ Framework \ WindowsPhone \ v8.0 \ System.dll'

Why System.ComponentModel.INotifyPropertyChanging

in the WP8 Libraries of the MVVM Portable NuGet Package? This is a bug because I think it conflicts with what is already in the mscorlib Windows Phone 8.

Please, help.

+2


source to share


2 answers


Try the latest versions of Portable.MvvmLightLibs (4.1.27.3). I had to remove INotifyPropertyChanging from the PCL version as there is really no way to get it to work across platforms.

We'll need Microsoft to provide a shim (similar to Microsoft.Bcl) for this to fit properly on WP.



If you need property change notifications (before the value changes - this is very rare and there is not much to use), one option might be to create your own interface and implement it in a derived type from ObservableObject (you can override RaisePropertyChanging methods to know when you need to raise your own event).

If Microsoft adds INotifyPropertyChangning support to the PCL, I'll make sure to add it back to MVVMLight.

+2


source


One simple solution you can use is to download the MVVM Light source code and remove all references to INotifyPropertyChanging in the ObservableObject. Compile the library yourself and it should work fine.



0


source







All Articles