Category Archives: Cinch

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.

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.

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

V1 which is targeted at Vs2008 and WPF only

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.