G
Guest
I'm thinking of building a complex data model with a number of nested classes
but need to know something first. To simplify my question, let me present
you this sample data model
MainClass
Questions (collection)
Question (class)
Text (property)
Answers (collection)
Answer (class)
Text (property)
Here's what I'm looking to find out: Without specially preparing this data
model with all sorts of extra fields is there any way for the two properties
shown to know what index of the collection(s) they're in, should the property
value be changed?
For example, let's say that:
Questions(10).Text = "What's your favourite animal?"
and for this question:
Answers(3).Text = "Dog"
thus: Questions(10).Answers(3).Text = "Dog"
Now say that this property is changed externally by some process to "Cat".
What I would ideally like to do is have this change fire an event that will
inform all listeners (ie. forms) change "Dog" to "Cat".
But I can't envision how to do this if this property isn't aware of where it
sits in the hierarchy.
Any ideas?
but need to know something first. To simplify my question, let me present
you this sample data model
MainClass
Questions (collection)
Question (class)
Text (property)
Answers (collection)
Answer (class)
Text (property)
Here's what I'm looking to find out: Without specially preparing this data
model with all sorts of extra fields is there any way for the two properties
shown to know what index of the collection(s) they're in, should the property
value be changed?
For example, let's say that:
Questions(10).Text = "What's your favourite animal?"
and for this question:
Answers(3).Text = "Dog"
thus: Questions(10).Answers(3).Text = "Dog"
Now say that this property is changed externally by some process to "Cat".
What I would ideally like to do is have this change fire an event that will
inform all listeners (ie. forms) change "Dog" to "Cat".
But I can't envision how to do this if this property isn't aware of where it
sits in the hierarchy.
Any ideas?