Cursored or non Cursored
Cursored set up is what we call the standard dialog display of one to many relationships. Like in normal master detail displays when the master has a current value, a cursor, that controls what details to show.
The non Cursored set up would be more like a tree – something that displays details for every parent available, not just the parent selected (the current master). This is what treeviews and reports do and it is something we want to be able to do using viewmodels as well.
Consider this model
And this ViewModel:
The ViewModelUserControl uses a cursored set up when generating a UI:
Giving us this in VisualStudio WPF Designer:
And in this UI the Cursor set up sees to it that the Class3 grid only shows the Class3 objects owned by the current row in the Class2 grid; this is the standard behavior.
Nothing new here for ECO5 developers really.
In ECO6 for Visual Studio 2010 we added a new ViewModel consumer: the BindableViewModel.
This component replaces the ViewModelContent (ViewModelContent is not removed, and BindableViewModel use ViewModelContent under the hood).
The reason for adding BindableViewModel is mainly to provide Design time binding support. This was not possible in the WPF designer for Visual Studio 2008, but it is for Visual Studio 2010.
Check out this code that defines two BindableViewModels one cursored and one that is not cursored:
We can then use the artifacts within the viewmodel.
Check out this treeview that use the non cursored BindableViewModel:
It looks like this at runtime:
Even if you are not going to use the Generated UI capabilities provided by the ViewModelUserControls you can still use the ViewModel-definitions. The ViewModel is a good place to keep any and all transformations you need between your domain layer and your presentation. The ViewModel also holds the infrastructure for verifying OCL expression and for Validation definitions (Described here). And now with the ability to use both a Cursored set up and a non Cursored set up the argument is even stronger. Top this with design time support to the bind to the ViewModel-classes and columns.