Caliburn.Micro for Csla

Caliburn.Micro for Csla

Old forum URL: forums.lhotka.net/forums/t/10178.aspx


tiago posted on Thursday, March 17, 2011

Caliburn.Micro is an open source project (MIT License) that provides a MVVM framework that supports WPF, Silverlight and WP7. It's powerful enough and yet simple enought to understand (around 1700 LOC).

I've made some extensions to Caliburn.Micro in order to better support Csla. A new ScreenWithModelBase<T> merges Csla.Xaml.ViewModel<T> with Caliburn.Micro.Screen class. Probably I should make a proper HG fork but haven't done it yet. Anyway it is working and if there are interested users, I can send the source or maybe decide to fork.

Tiago Freitas Leal

RodWatkins replied on Friday, March 18, 2011

Yes, I am interested. can you send the source.

Rod

tiago replied on Friday, March 18, 2011

Hi Rod,

You can fetch the zip at http://forums.lhotka.net/members/tiago/files/default.aspx

Note the WP7 part was left out just because I didn't install WP7 support and VS2010 refuses to load the project.

JCardina replied on Tuesday, May 10, 2011

Hi Tiago, I'm looking at different MVVM frameworks and thought Prism was the way to go but now seeing Caliburn it's looking more and more interesting as I get to know it better.

I think I see where your extensions will fit in however I'm concerned that this involves modifying the source of the Caliburn framework.  I decided this time around to not modify Csla as I have in the past to make it easier to keep current.  I'd like to do the same thing with my MVVM framework if possible.

Is there any way to accomplish what you did without modifying the Caliburn framework?

Are your changes restricted to *only* ScreenWithModelBase<T> and all the rest of Caliburn is untouched?

Without your extensions is Caliburn unusable with CSLA or does it just mean a lot more work to use it with CSLA?

Any help appreciated.

Cheers!

- John

tiago replied on Tuesday, May 10, 2011

Hi John

JCardina

Is there any way to accomplish what you did without modifying the Caliburn framework?

 

I didn't modify CM code in any way; just added some classes that implement some interfaces.

JCardina

Are your changes restricted to *only* ScreenWithModelBase<T> and all the rest of Caliburn is untouched?

Yes. I've made those class sometime ago and updated CM over and over again with no changes to these classes. My test project keeps running faultlessly.

No. I also ported IHaveSubject and its base class from Caliburn "The elder". But you can remove it if you dont like it. Just like IHaveModel it's just an add on and no code changes were made to CM itself.

JCardina

Without your extensions is Caliburn unusable with CSLA or does it just mean a lot more work to use it with CSLA?

 

You can use the basic Caliburn.Micro with Csla. I used to do it. There is some more work involved to use the basic features. Compare the old way

public class DocEditViewModel : ViewModel<Doc>, IChild<object>, IViewAwareIHaveDisplayName

with the new way

public class DocEditViewModel : ScreenWithModel<Doc>

I made ScreenWithModel in order to make it easier to use Caliburn.Micro and Csla. I really can't remember exactly what features i was finding difficult to use.

In a nutshell, ScreenWithModel<T> makes life easier, cost nothing to use (cost like in maintenance cost) and doesn't compromise compatibility with both Caliburn.Micro and CSLA frameworks.

JonnyBee replied on Wednesday, May 11, 2011

Hi all,

Thanks to Tiago for donating the extension in Caliburn.Micro to CslaContrib.

These extensions is now available in CslaContrib as separate projects/assemblies for easier updates to Caliburn.Micro releases and will help you useCsla business objects with Caliburn views/viewmodels.

 

 

JCardina replied on Wednesday, May 18, 2011

Hi Tiago, thank you for your reply.  I never got notified that you had replied by the forum software so I thought you hadn't but I just went back and looked and found your detailed info.  I've since settled on Prism (I think) but I'm going to look at screenwithmodelbase again to see if I can steal anything you did there. :)

Cheers!

tiago replied on Tuesday, May 17, 2011

Since there is a growing interest in MVVM, I thought you might find interesting to know Caliburn.Micro is the successor of Caliburn "The Elder". Rob Eisenberg declared there will be no more development on Caliburn "The Elder".

"Caliburn is a legacy framework maintained to support existing apps. Future development is focused on Caliburn.Micro." he says in the Project Description of Caliburn "The Elder" (check it out at http://caliburn.codeplex.com/)

Copyright (c) Marimer LLC