All blog posts with a title that starts with [MVVMbasics] are related to the MVVMbasics framework. If you are only interested in my regular blog posts and not in MVVMbasics, ignore these. To list all articles covering MVVMbasics, go to http://mvvmbasics.mobilemotion.eu/documentation!
Simplified package structure
With version 2.0, finally the complicated package structure consisting of the “core” package MVVMbasics and the platform-specific Extensions packages belongs to the past.
Now, there is only one package: To add the MVVMbasics framework to any project of any type, simply search NuGet for “MVVM basics” and download and install the MVVMbasics package – that’s it! NuGet will automatically add those packages that are required by each project.
Of course, you can still decide whether you want to keep all parts of your application in one project, or create different platform-specific projects containing the Views and one Portable Class Library containing data models and Viewmodels in order to create a cross-platform solution. In both cases, you only need to add the MVVMbasics package to each project. In case of a platform-specific project type, NuGet will add both a reference to MVVMbasics and to one of the platform-dependent extension libraries called MVVMbasicsWPF, MVVMbasicsRT, or MVVMbasicsPS – as you can see in the project’s References section in Solution Explorer. In case of a Portable Class Library, Nuget will add only the core MVVMbasics reference. However, no need to worry about that – since everything happens automatically there’s no need to even think about these internals.
MVVMbasics can be included in projects targeting:
- WinRT (Windows Store 8.1, Windows Phone 8.1, and Universal Apps)
- WPF (.NET 4.5)
- Windows Phone 8.0 (Phone Silverlight)
Unfortunately, WPF for .NET 4.0 and Windows Phone 7 are not supported any more. If you still need support for one of the two platforms, go for version 1.9, as described in Which version to use?
When adding MVVMbasics to a Universal App project, you should in any case install the MVVMbasics package into the Windows, Windows Phone, and the Shared project to ensure that all functions and features of MVVMbasics are available in both apps. If you want to keep the project extendable, I’d suggest that you add a Portable Class Library to the solution, create all Models and Viewmodels in there, and reference this PCL project from within the Shared project. This way, you can add support for additional platforms in the future with limited effort. In this case, the MVVMbasics package needs also to be installed into the PCL project.
Ready to dive into MVVMbasics‘s new coding features? Then continue with Part #2: Simplified Data Binding with more flexibility!