1

I have a pair of controls, let's call them BigDaddy and Flea. One or more Flea elements may appear anywhere in the visual tree of BigDaddy. Is there any way to detect the adding/removing of Flea objects on BigDaddy given that there is no requirement that it be an immediate child?

Example trees:

<my:BigDaddy>
    <my:Flea /> <!-- Flea is an immediate child -->
</my:BigDaddy>

-- OR --

<my:BigDaddy>
    <SomethingElse>
        <Canvas>
            <my:Flea />
            <!-- Flea is not an immediate child but still needs to be detected -->
        </Canvas>
    </SomethingElse>
</my:BigDaddy>
Richard SP.
  • 497
  • 6
  • 15

1 Answers1

0

I believe you could try something with reflection and property tracking, like when BigDaddy loads you can check the visual tree for a Flea element using reflection and then add a property changed listener to it's parent to track the Children nodes.

VojtechStep
  • 43
  • 1
  • 7