This project has moved. For the latest updates, please go here.

ViewModelClass Element

The ViewModelClass element contains the information that is used to generate a single ViewModel class.


<ViewModelClass name="..." namespace="..." modelClass="..." implementIEditableObject="..." commandClass="..." collectionClassName="...">
<BaseClass ... >


Name Type Required Description
name string yes The name of the ViewModel class that will be generated
namespace string yes The namespace of the ViewModel class that will be generated
modelClass string no The class (including the namespace) that exchanges data with the ViewModel class. If omitted no mapping logic will be added to the ViewModel class
implementIEditableObject boolean no When set to true the generated ViewModel class will implement IEditableObject
commandClass string no Specifies the class (including the namespace) that will be used to generate the Commands on the ViewModel class
collectionClassName string no When specified a class will be generated with this name that derives from ObservableCollection<T> and uses the generated ViewModel class for parameter T. The collection class will also implement a static method FromModel that creates an instance of the collection class and fills the collection with instances of the ViewModel class. These instances are created based on the IEnumerable collection of Model classes. TODO: make a seperate page for the collection class and generated code in general

Child Elements

Name Multiplicity Description
BaseClass 0..1 The base class of the generated ViewModel class.
Properties 0..1 A collection of Property elements that define the properties of the generated ViewModel class.
Commands 0..1 A collection of Command elements that define the commands of the generated ViewModel class.

Last edited Jun 20, 2010 at 12:32 PM by Erno_de_Weerd, version 7


No comments yet.