Click here to Skip to main content
12,813,994 members (32,299 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 3 Mar 2014

WinRT : StyleMVVM Best Of Breed MVVM Framework (IMHO)

, 3 Mar 2014 CPOL
Rate this:
Please Sign up or sign in to vote.
About a year ago I contacted by this uber sharp american guy called Ian Johnson, who asked me if I would be so kind as to review his upcoming Windows 8 MVVM library. I stated that I was currently on holiday, but when I got back I would be glad to. Now I have been […]

About a year ago I contacted by this uber sharp american guy called Ian Johnson, who asked me if I would be so kind as to review his upcoming Windows 8 MVVM library. I stated that I was currently on holiday, but when I got back I would be glad to. Now I have been in pretty much constant contact with Ian over the past year and have been fielding his questions, and we have even written a joint article (Expression API Cookbook) . What immediately struck me about Ians framework (here after known as StyleMVVM) was how feature rich it was, and how well thought out it all was. Remember I have taken time to look at his code base.

At the time I was lucky enough to be asked to be an advisory member for the new PRISM offering for Windows 8 code name “Kona”. I didn’t really have enough time to do much on this but it was still an honor. Though I have since spent quite a bit of time getting to known “Kona” now known as “PRISM for Windows Runtime“.

Now I love PRISM and have nothing but respect for that team, and previous team members, but I have to also say at the moment, I prefer the StyleMVVM offering, as I think it is just more feature rich, and some of the code seems to be better to use than PRISM for Windows Runtime.

One thing I really liked in StyleMVVM was the fact that Ian had written a Expression Tree (fast as hell) IOC container from scratch. He has bench marked this and it is rihgt up there, with speeds far exceeding Castle / Unity and AutoFac. It is based around the MEF style attribute model, but fluent registration is also happening any second now (I know I have seen the beta versions of it, and it looks very cool). Ian is very proud of this piece of StyleMVVM , and rightly so, its awesome.

Now that is no small thing, for a single individual to come up with a framework as feature rich as one of the big boys in the MVVM arena, kudos to Ian.

I believed in Ians work so much I have been working on a demo app using it in my spare time. This demo app will be the source for a series of articles on how to use StyleMVVM which I hope to have out there in the wild very soon. You will hear about it here. In the mean time I just want to list some of the features of StyleMVVM, which I have shamelessly stolen from the StyleMVVM codeplex site.

Some of the core features are:

  • StyleMVVM is the only MVVM toolkit for Window Store App that supports all three development languages C#, C++/CX and HTML/JS. Allowing you to export components written in C++/CX and import them into a C# applications.
  • Built in validation engine that supports ValidationAttributes, Fluent validation and Method validation depending on your needs. You can validate ViewModels as well as DataModels.
  • Conventions module to allow for easier development, as well as templates to setup your project to use conventions.
  • Event Handlers can be easily hooked up to your view model using the simple syntax View:EventHandler.Attach=”EventName => ViewModelMethod($sender,$eventArgs); etc…”
  • Supports Regions similarly to Prism with region registration happening in XAML and navigation being driven from the ViewModel
  • Attribute Based IoC container (Export, Import), container is also environment aware and sorts exports accordingly returning the best match at Locate time (RunTime, DesignTime, UnitTest).
  • Fluent interfaces for configuring IoC Container programatically (required for C++/CX and Windows Runtime Components)
  • Design time ViewModel support. ViewModels are located at design time using IOC so you can use your real ViewModel and replace your IDataService with a Faux version for Design and UnitTest.
  • Auto Registration of Views & WCF Clients (i.e. all classes inheriting from ClientBase<T> & Page)
  • Implementations for ICommand and Attached Event Commands.
  • Messenger service that is Dispatcher Aware (i.e. handlers are called back on the proper dispatcher)
  • NavigationViewModel that is tied into the Metro Page Navigation system (Supporting Navigate method & Navigation Events)
  • Extensible logging solution
  • Configuration service that is expandable by Exporting the IConfigurationStorageProvider interface
  • Improved Suspension Manager (auto adds DataContract classes to KnownTypes)
  • IMessageBoxService & IFilePickerService wrappers that allow you to mock out your dialogs for Design and Unit Testing purposes
  • ICharmService make creating flyout easy by automatically registering charm controls with the SettingPane.
  • ITileService, IBadgeService, & IToastService allow for easy updates of tiles and toasts.
  • IActivationService that can create or clone any Object (satisfying Imports and message registration)
  • ITransformService can transform data objects from one type to another using reflection and Linq Expressions, you can use the Transform attribute to give the service hints on how to transform the property.
  • Visual Studio Template for Projects and Items

So you can expect to see some more material on how to use StyleMVVM very soon. If you just can’t wait, grab the code and have a look at the demo, which is very good and showcases most of the features very nicely.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Sacha Barber
Software Developer (Senior)
United Kingdom United Kingdom
I currently hold the following qualifications (amongst others, I also studied Music Technology and Electronics, for my sins)

- MSc (Passed with distinctions), in Information Technology for E-Commerce
- BSc Hons (1st class) in Computer Science & Artificial Intelligence

Both of these at Sussex University UK.


I am lucky enough to have won a few awards for Zany Crazy code articles over the years

  • Microsoft C# MVP 2016
  • Codeproject MVP 2016
  • Microsoft C# MVP 2015
  • Codeproject MVP 2015
  • Microsoft C# MVP 2014
  • Codeproject MVP 2014
  • Microsoft C# MVP 2013
  • Codeproject MVP 2013
  • Microsoft C# MVP 2012
  • Codeproject MVP 2012
  • Microsoft C# MVP 2011
  • Codeproject MVP 2011
  • Microsoft C# MVP 2010
  • Codeproject MVP 2010
  • Microsoft C# MVP 2009
  • Codeproject MVP 2009
  • Microsoft C# MVP 2008
  • Codeproject MVP 2008
  • And numerous codeproject awards which you can see over at my blog

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170308.1 | Last Updated 3 Mar 2014
Article Copyright 2014 by Sacha Barber
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid