This project is read-only.

ViewModel that's derived from BusinessBase help.

Nov 28, 2010 at 3:17 PM

I'm using CSLA 4.0 and using CodeSmith CSLA templates to generate the required files. When I create a viewmodel using an object that is derived from BusinessBase and use that viewmodel with a view, the Model property when shown in the data source window always displays as a grayed out icon. The object that’s derived from BusinessBase contains a number of properties including a property that’s a list of other objects. I can use this this list of objects property in a listbox but what the listbox doesn’t do is move from object to object. It seems that because the type of the viewmodel is a BusinessBase, all object below that are treated as a single property/object. I wondering if someone can help me understand what would cause this to happen and how I might work around this.



Nov 28, 2010 at 5:27 PM

This sounds more like a CSLA question than a Bxf question, and so should probably go in rather than here.


CSLA mostly helps you create the Model objects, not really the ViewModel objects. BusinessBase certainly isn't designed to help create a viewmodel.

The exception is that in Csla.Xaml there are ViewModelBase<T> and ViewModel<T> base classes that do help you create viewmodel objects. If you use ViewModel<T> to create a viewmodel, the T type is the type of your model, and is often a subclass of BusinessBase. The Samples\Net\cs\SimpleNTier and Samples\Silverlight\cs\CslaMvvmSl examples show exactly what I'm talking about here, and of course the CSLA 4 MVVM video series walks through it in detail.