I currently have an app (in Silverlight), using mv-vm, that has an interface to add/edit/remove various entries to a database. A good analogy would be a page for ordering a car with many checkboxes and comboboxes for whatever features you wanted the car to include.
My app has many of these UI elements (even including TreeViews with TreeViewItemCheckBox'es) that I want to map to a data object that uses a dictionary to store any included options.
My struggle is finding the best way to map these UI elements to my view model so that they can be compiled and sent to the database. My initial direction was to map each Element to a property in my view model, but it seems heavy and clumsy.
<TreeView>
<TreeViewItem>
<TreeViewItem.Header>
<TreeViewItemCheckBox Content="All Features" IsChecked="{Binding AllFeaturesChecked}"/>
</TreeViewItem.Header>
<TreeViewItemCheckBox Content="Feature1" IsChecked="{Binding Feature1Checked}"/>
<TreeViewItemCheckBox Content="Feature2" IsChecked="{Binding Feature2Checked}"/>
<TreeViewItemCheckBox Content="Feature3" IsChecked="{Binding Feature3Checked}"/>
<TreeViewItemCheckBox Content="Feature4" IsChecked="{Binding Feature4Checked}"/>
</TreeViewItem>
</TreeView>
...multiply by 10 and you get the idea.
Can anybody think of a better way of going about this?
Thanks!