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.

Advertisements

4 thoughts on “Cinch news

  1. Damien says:

    Sacha,

    Thanks for your hard work. V2 definitely looks very promising. As far as I am concerned, I’m looking forward to seeing what you have in store for Blend and design time data supports. SL support is clearly what was “missing” from v1 and would be a great addition. As for MEF, it really seems like the “big thing” these days. I haven’t had time to read about it yet, but I think I should give it a try before v2 is coming! 🙂

    Good luck!

    Damien

  2. Michael says:

    Sacha,

    How tightly coupled will Cinchv2 get with MEF? Will Cinchv2 be worth a look for non-MEF users?

  3. Hi,

    Do you plan of doing a getting started very compact article so a new comer can start using your framework asap.

    Thanks

    • sacha says:

      No I will not be doing an uber quick get started guide, that is not something I think is a good idea. I think people using frameworks should understand them too. I am writing 6 articles and CinchV1 also had 6, so that is 12 articles that people should read. That is a lot of information to condense into 1 article…it would never have enough detail for people to get started. The 12 articles do cover almost everything, so by reading these the reader should gain a very thorough understanding of how to work with Cinch, which is what I am really aiming for.

      Hope that answers that one for you.

      There are already 2 new articles out there for Cinch V2

      http://www.codeproject.com/KB/WPF/CinchV2_1.aspx
      http://www.codeproject.com/KB/WPF/CinchV2_2.aspx

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: