Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Portable Class 4.0: Missing Features

I want to use the Portable Class Project for my MVVM-Concept (share the dll between WPF and Silverlight).

For WPF I want to target Dot.Net 4.0 and Silverlight targets Version 5.

Sadly the portable project does not support some key features for my view-model like the ObservableCollection. Curiosly the ObservableCollection is supported in both standalone versions (Dot.Net 4.0 and SL 5).

Has anyone an idea why I can't use this collection? When I switch to Dot.Net 4.5 it is available.

like image 835
Klaus Avatar asked Feb 03 '26 02:02

Klaus


1 Answers

This is just a result of the fact that .NET 4.0 was the first version of .NET that supported portable libraries, and we didn't have time to make the "ViewModel" types (ICommand, ObservableCollection, etc) portable.

The technical reason is that the types are in System.Windows.dll on Silverlight, but they were in a WPF assembly (PresentationCore.dll I think) in the .NET Framework. In .NET 4.5 we added a version of System.Windows.dll to the .NET Framework with type-forwards to the right place.

like image 135
Daniel Plaisted Avatar answered Feb 05 '26 14:02

Daniel Plaisted