Parent-ChildList-Grandchild relationship question

Parent-ChildList-Grandchild relationship question

Old forum URL: forums.lhotka.net/forums/t/8115.aspx


JuniorG posted on Tuesday, December 08, 2009

I see lots of posts about people accessing parent methods/properties from the child, but I am trying to work the other way.

I have a Parent root base object that contains a collection of children. When I write code in the child, I can access the List parent object, but not the root object (Parent of the Parent). I think most of that logic should live in the base Parent anyway, but I was just throwing that out there.

I have a OnChildChanged override that just calls the base.OnChildChanged so that I can check to see if changed events are being propogated on the children and they are! The problem I am running into is that when I set a rule on the root object and try to access the Child property in the list, the rule never fires. If I put the child property name in directly I get a compiler warning that the Property is not available in this context (which is correct because it lives on the child which is encapsulated). A co-worker suggested I put the property name in quotes and it should work. Still no firing of the rule. Any suggestions? Any thoughts of something I may be missing?

JoeFallon1 replied on Tuesday, December 08, 2009

This has been discussed many times. I think you are hooking the "wrong" event. Maybe it is ListChangedEvent that you want. Try searching this forum for these key words and you should probably find a post that answers your question more completely.

Joe

 

Copyright (c) Marimer LLC