简体   繁体   中英

C# MVVM application frameworks for Windows (Desktop) and Windows Phone 8

Please suggest me some good MVVM and IOC application frameworks that can maximize code sharing between Windows 7/8 and Windows Phone 8 (and possibly for a Modern UI app in future)

The desktop app will be WPF based and the Phone app will be XAML + C# based.

The overall application will composed of pluggable components that can be dynamically enumerated from assemblies.

We also want to go with the purist version of MVVM where Model, View and ViewModel can reside in their own independent projects. We also need the ability to compose a view from multiple sub views which can reside in their own assemblies.

MvvmCross - Stuart's blog , videos , jabbr room

MvvmCross is an Mvvm framework tailored for development targeting Xamarin.iOS, Xamarin.Android, WindowsPhone, Windows Store, WPF, and Mac. Personally, it's still a great framework even if you're only targeting WPF, WP, and Windows Store.

It has a plugin model for cross platform components, implements it's own IoC container, and has a messenger, among other cool things. MvvmCross implements bindings for the different platforms as well and as a result can do some cool things with bindings, see Rio .

Caliburn Micro - docs

Caliburn Micro targets the XAML technologies, WPF, SL, WP, WStore. It's has a lot of conventions for doing things like auto binding a button to a method by matching the name of the button x:Name="Send" to the Send method on the view model. All of the conventions are configurable. CM also implements it's own IoC container and has a messenger.

QuickCross - A lightweight, code only, Mvvm framework. Interesting and worth looking at.

MvvmLight - also excellent and provides the essential Mvvm things.

All are excellent open source projects with healthy communities. I'd suggest writing a small to medium sized application with a couple. They all have great docs but the source code can provide further insight.

I don't know about what your application looks like, but first thing I would do is to develop the WPF application using a 3-tier architecture so the "back-office" part (ie server-side) of the application exposes WCF services that are developed once, and can be consumed by all your clients (Windows Phone, WPF, Modern UI app...).

Then for the client side, I would suggest using the PCL release of MVVM light Toolkit . I haven't tested the PCL version yet, but I always recommend this library for MVVM developments.

That being said, if the "pluggable" requirement you have is strong and you don't want to build it from scratch, you might want to have a look at Prism . I didn't have a chance to test it yet, but it's worth trying as it's supported in WPF/Silverlight/WP7 scenarios.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM