views:

255

answers:

1

I am deriving a class from the Silverlight Panel class so that I can perform some custom positioning of the child elements of the panel. How do you find out when the collection of child items has been changed? The Panel.Children collection does not have any events indicating change notifications.

Do I have to scan the Children collection each time a measure occurs and look for the elements that have been added and disappeared?

+1  A: 

Try this post: Silverlight: Getting notified upon changes to a Panel’s Children (of type UIElementCollection) property. Not a perfect solution, but might help.

Gordon Mackie JoanMiro
Interesting approach to the problem but sadly not a generic solution. It only works as long as the derived class is used but will fail when used as the base Panel class. Still, maybe that is as close as it is possible to get.
Phil Wright