Hi.
I have the following scenario.
I have a WPF form with a datagrid on it
The datagrid is hook up using binding to a Qbservalcollect ion. The datagrid should be seen as a propertyeditor. Like the on in visual studio
1 Colum with the propertyname (this is read only)
1 Colum with the propertyvalue
The basic model for the collection is contaning.
Public PopertyName
Public PropertyValue.
This is quite simple and works fine, when passing data to the collection is gets populated in the view.
Now come the tricky part, in the viewmodel there is a eventhandler reacting on a message from another viewmodel.
I takes a propertyobject, the object can differ from message to message.
It is the eventhandles taks to translate the propertobject into something the can be shown in the data grid.
e.g.
a propertyobjec could look like this
id = 100
name = "Action1"
time1 = "1000"
time2 = "2000"
and so on.
This is stille quite ok to show in the data grid, BUT
some of the Values would be nice to show as preselected values in a combobox in the datagrid, but only some, and this differs from propertyobject to propertyobject
e.g.
in one message Value pair number 3 should be a combobox in the datagrid.
in another message it should be Value pair 5 7 8 the should be shown as combobox in the data grid.
As im using a MVVM approche this should be done using biding and some dynamic content template or something.
The question is how should this be done ?
Br.
Michael Rahr
I have the following scenario.
I have a WPF form with a datagrid on it
The datagrid is hook up using binding to a Qbservalcollect ion. The datagrid should be seen as a propertyeditor. Like the on in visual studio
1 Colum with the propertyname (this is read only)
1 Colum with the propertyvalue
The basic model for the collection is contaning.
Public PopertyName
Public PropertyValue.
This is quite simple and works fine, when passing data to the collection is gets populated in the view.
Now come the tricky part, in the viewmodel there is a eventhandler reacting on a message from another viewmodel.
I takes a propertyobject, the object can differ from message to message.
It is the eventhandles taks to translate the propertobject into something the can be shown in the data grid.
e.g.
a propertyobjec could look like this
id = 100
name = "Action1"
time1 = "1000"
time2 = "2000"
and so on.
This is stille quite ok to show in the data grid, BUT
some of the Values would be nice to show as preselected values in a combobox in the datagrid, but only some, and this differs from propertyobject to propertyobject
e.g.
in one message Value pair number 3 should be a combobox in the datagrid.
in another message it should be Value pair 5 7 8 the should be shown as combobox in the data grid.
As im using a MVVM approche this should be done using biding and some dynamic content template or something.
The question is how should this be done ?
Br.
Michael Rahr