I’m using the M-V-VM pattern.
I have a ViewModel and an ObservableCollection of DataModels.
The list of DataModels are data-bound to a DataGrid.
When the grid is rendered, i would like one of the fields to be a ComboBox (let’s say a list of string names).
This string name list is a common list that applies to all rows (i.e. DataModels).
Is there a way to bind a grid’s field-level row property to the parent ViewModel?
One possible solution that i’d like to avoid is this:
Have a get-property in the DataModel that essentially returns the ViewModel’s property (the list of string names).
you can do it with a static resource.
E.g. define your static resource in xaml
Now you can reference this resource in your user control:
Hope this helps,
BR,
TJ