Cinch, MVVM, Silverlight, WPF

CinchV2 and PRISM 4 Interoperability

I have been working on 2 small demo apps using my CinchV2 MVVM framework code used in conjunction with the latest PRISM 4 release (which now uses MEF).

I am actually pretty happy with the results of how easy these 2 frameworks work together, it is almost seamless.

So if you are a fan of PRISM features such as Regions/Modules etc etc, but want some of the goodness from Cinch like the ViewModel base classes and UI Services, then the article I have made to cover these demo apps could be for you.

The url to the article is right here :


Silverlight Navigation And CinchV2 for Silverlight

As some of you may recall I recently managed to push out V2 of my MVVM framework Cinch which also included support for Silverlight. Back in the days when I wrote Cinch V1 I included a LOB application, but I did something slightly more fun and interesting for the Cinch V2 codebase and matching articles.

I did get some flack for this, but being thick skinned (and tired) I shrugged it off. Luckily one codeproject (the source of all the Cinch articles) reader, thought it would be neat to show you how to create a Silverlight navigation enabled application using Cinch V2.

I am incredibly happy this has happened, as it is something I did not do, and it is something most Silverlight Applications will need. It makes use of the standard Silverlight navigation support, i.e : Frames / UriMappings etc etc, and of course does this using MVVM and it uses Cinch V2. So massive thanks for Ben Wintringham for taking it apon himself to do this and publish it.

Here is a link to Bens article:

How to convert a Silverlight Navigation Application to use MVVM using How to convert a Silverlight Navigation Application to use MVVM using Cinch V2.

If you use Cinch V2 for Silverlight (or WPF and have a general interest), I would urge you to read this article of Bens.

C#, Cinch, MVVM

Cinch + SVN

My last post stated that I had uploaded CinchV2 fixes all ok, as it turns out SVN has mangled a merge, so I will need to upload again. Apologies, I will do this tonight. All was ok on my box. GRRRRR

C#, Cinch, MVVM, Silverlight, WPF

Cinch news

For those of you that are using my Cinch MVVM framework framework I have some very good news for you. This weekend I did a lot of work to the framework in preparation for a massive overhaul I am just about to give Cinch to allow .NET 4/VS2010 / Mef support.

The changes for .NET 4/VS2010 / Mef support represent what I deem to be a new codebase, so that is bad news as there will be some breaking changes for current users, but I think the new version of Cinch will be a superior framework to use. And I expect it will be a while before most people make the jump to .NET 4/ vs2010 anyway.

The good news, is that I have made a lot of changes to Cinch V1 (WPF only) this weekend, which are as follows:

  • Made it so default Simple Logging Facade based logger, can be swapped out for another ILogger based logger, which will allow the dependency on Slf.dll to be removed if you do not choose to use SLF and instead write your own ILogger implementation and inject that. SLF is the default though, so for now Cinch has a dependency on SLF.
  • Made a new interface called IIOCProvider which allows the IOC Container to also be swapped out. The default is Unity, and Cinch currently uses a UnityProvider, again if you wish to write a IIOCProvider and pass that into the new Cinch base ViewModel constructors, you will be able to remove the dependency on Unity.  Unity is the default though, so for now Cinch has a dependency on Unity.
  • Gave the Mediator a massive overhaul, so it now allows lamda registration/unregister. It also provides asynchronous NotifyCollegues methods. There is also a Mediator singleton which may be accessed using the Mediator.Instance singleton. The ViewModelBase class does a register on construction and unregister on Dispose.
  • Changed the MediatorMessageSinkAttribute, so that users no longer need to specify the parameter type. This is a breaking change, sorry. The Cinch V1 demo code shows the new way of dealing with the Mediator attributes.
  • Altered the way the IUIVisualizer service is initialised. This is now done with a callback Action<IUIVisualizerService> delegate. This is a breaking change, sorry. The Cinch V1 demo code shows the new way of dealing with the IUIVisualizer service.
  • Provided properties in ViewModelBase for IsLoaded/IsUnloaded/IsActivated/IsDeactivated. Though overriders if the virtual view lifetime methods will have to remember to call base methods in order  for these new properties to work
  • Made various other small changes, basically I tried to do all oustanding issues/discussions and patches from the Cinch codeplex site.

So that should help those using VS2008, these changes are available right now

So what have I got in store for you with the next version, well I plan to get rid of 3rd party IOC containers entirely and use MEF. There will also be much much better Blend support, and design time data considerations will be paramount in what I am trying to achieve.

The view lifecycle attached commands will also be made into a ViewAware service that the viewmodels can use.

This is going to be a big set of changes, and I will also be trying to get this all to work for Silverlight 4 and upwards too, so it could take me a little while, but I am looking into it.

In the mean time I will update all the existing Cinch codeproject articles.

NOTE : One thing to note is that when you download Cinch after I have it all working it will contain

  1. V1 which is targeted at Vs2008 and WPF only
  2. V2 which is target at Vs2010 and will be for WPF and SL

Stay tuned, I will be writing a series of articles on Cinch v2 when I have it done.