Lets say the model looks like this: (plants are easier to describe than telephony system acronyms)
class CornAttribs
dim numKernels
class OnionAttribs
dim numLayers
dim color
class Vegetable
Implements INotifyPropertyChanged
....snip notify related stuff
dim name as string
dim attrib as object 'point to Corn or Onion
During runtime the data could look like this:
Vegetables:
"corn1", numKernels = 60
"onion1", layers = 10, color = white
"corn2", numKernels = 80
In my form I want to have a grid that is bound to a CollectionView to shows certain named vegetables. Lets just say there is no filter on the view for this example, but there could be. I want the grid output to look like this:
===========================
Onion | Layers | Color
--------------------------
onion1 | 10 | white
===========================
Corn | Kernels
--------------------------
corn1 | 60
corn2 | 80
==========================
There is a limited number of "attrib" objects so I would have distinct markup for each grid.
Is OK to continue down this path or if I should have all 3 objects be collections and have the name attribute in each and remove the attrib member in Vegetable? (this is my current implementation, however the "Model" code could be simplified if I am able to use the above)
My question sort of boils down to: At each change of the type of object pointed to by the attrib member, can WPF switch grid column definitions and also display a new header?
Thanks in advance.