我有一对控件,我们称它们为BigDaddy
and Flea
。一个或多个Flea
元素可能出现在BigDaddy
. 鉴于不需要它是直系孩子,有什么方法可以检测Flea
对象的添加/删除?BigDaddy
示例树:
<my:BigDaddy>
<my:Flea /> <!-- Flea is an immediate child -->
</my:BigDaddy>
- 或者 -
<my:BigDaddy>
<SomethingElse>
<Canvas>
<my:Flea />
<!-- Flea is not an immediate child but still needs to be detected -->
</Canvas>
</SomethingElse>
</my:BigDaddy>