CSLA & MVVMLight

CSLA & MVVMLight

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


dblwizard posted on Monday, May 14, 2012

Howdy All,

Does anybody have any examples of using CSLA with MVVMLight?  I'm trying to figure out how to hook up the WCF and DataPortal calls.  I see the BeginRefresh in samples using CSLA but that is using the ViewModel from the CSLA foundation that is build with Generics.  Does anybody have any suggestions or resources I might could use?

Thanks

dbl

JonnyBee replied on Tuesday, May 15, 2012

Hi,

I have looked into Caliburn.Micro and my recommendation is to "merge" most of the Csla.Xaml.ViewModel into the ViewModel base class in your selected UI framework.This is available for Csliburn.Micro in http://cslacontrib.codeplex.com (goto Source tab and download latest source)

I'd be interested in publishing similar code for MvvmLight on Codeplex if you can share the code with the community!!

dblwizard replied on Wednesday, May 16, 2012

I'll be glad to when I get it working.  Are there any examples out there that don't use the "ViewModel" object to do the delegate and data transfer?  Seems all the samples I find use the ViewModel inheritance to implement that.

RockfordLhotka replied on Thursday, May 17, 2012

I think that all the samples do use the base class because it simplifies coding.

But you can look at the ViewModelBase code itself to see what is done. The code in that class could be written directly in your code-behind, or in your own viewmodel base class, or your own viewmodel. It isn't that terribly complicated, but it isn't the sort of code I want to write in every viewmodel, and that is why I put it in a base class.

http://www.lhotka.net/cslacvs/viewvc.cgi/core/trunk/Source/Csla.Xaml/ViewModelBase.cs?view=markup

Copyright (c) Marimer LLC